Menu

#156 [wxFreeChart] bug in StackedBarType

open
nobody
None
5
2013-03-01
2013-03-01
julien
No

Hi I found a bug in wxFreeChart StackedBarType class.
When creating a stacked bar graph with more than 2 series, bars a not properly stacked.

I propose the following fix in src/bars/barrenderer.cpp. It worked fine for me.

void StackedBarType::GetBarGeometry(CategoryDataset *dataset, size_t item, size_t serie, int &width, wxCoord &shift, double &base, double &value)
{
width = m_barWidth;
shift = -m_barWidth / 2;
base = m_base;
for(size_t serie_iter = 0; serie_iter < serie; serie_iter++) {
base += dataset->GetValue(item, serie_iter);
}
value = dataset->GetValue(item, serie);
value += base;
}

Julien

Discussion


Log in to post a comment.