![]() |
UpdateDiagram() buggy! |
Post Reply
|
| Author | |
znakeeye
Senior Member
Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Quote Reply
Topic: UpdateDiagram() buggy!Posted: 04 September 2011 at 7:02pm |
|
Consider this type of diagram: ![]() Clearly, the coloring is wrong. I've tried playing with SetColorEach() and SetLegendVisible() but with no success. Digging into the source code reveals the issue. UpdateDiagram() does not check for the above! Palette index should be reset for each series! void CXTPChartContent::UpdateDiagram() { int i; int nIndex = 0; for (i = 0; i < GetSeries()->GetCount(); i++) { CXTPChartSeries* pSeries = GetSeries()->GetAt(i); if (!pSeries->IsVisible()) continue; if (!pSeries->GetStyle()) continue; if (pSeries->GetStyle()->IsColorEach())
{ for (int j = 0; j < pSeries->GetPoints()->GetCount(); j++) { pSeries->GetPoints()->GetAt(j)->m_nPaletteIndex = nIndex++; } } else { pSeries->m_nPaletteIndex = nIndex++; } } } |
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
znakeeye
Senior Member
Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 September 2011 at 7:11pm |
|
And... just as usual the most critical functions are not virtual. Unbelievable! :(
XTPChartContent.h: void UpdateDiagram(); CXTPChartDeviceContext* CreateDeviceContext(CXTPChartContainer* pContainer, HDC hDC, CRect rcBounds, BOOL bWindowDC);
|
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
znakeeye
Senior Member
Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Quote Reply
Posted: 07 September 2011 at 10:46am |
|
While I'm at it, how do you set a title text above/under each pie?
|
|
|
PokerMemento - http://www.pokermemento.com/
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |