I'm using freechart to drawing ganttchart and found a bug of categoryaxis when there are only one category(one task in ganttchart),freechart just can't show any chart.
bellow is the patch:
//--------------------------------------
categoryaxis.cpp
//--------------------------------------
void CategoryAxis::GetDataBounds(double &minValue, double &maxValue)
{
minValue = 0;
if (m_categoryCount > 1) {
maxValue = m_categoryCount - 1;
}
else if ( m_categoryCount == 1 )
{
maxValue = 1;
}
else {
maxValue = 0;
}
}
this patch runs OK,but is there more elegant fixing?
BTW:I'm using freechart to draw "resource occupy" ganttchart,but I found that it' really not so elegant as you have to drawing in"task" mode.
"resource occupy" chart means there many resource(such as machines),and occupy by task(such as client/order) along time line.
Is there a elegant way to drawing such chart?