Originally posted by: martin
I would like to use bar chart with different colors in the same bar, like that:
----
| |
| |
----
| |
----
| |
----
If some one has aldready did it or if some one has some idea abput the way to do it. Can you help me ?
thank you
Reply
Originally posted by: microsand
CDataPoint DataPoint;
I don't know what's wrong,Can you help me?
Thank you for your cool CChartCtrl,It help me very much!
but when i use the follow code,it crushed at once,the code is:
for(int i=2;i<4000;i++) //when use 'i<3000,it run ok!!!
{
DataPoint.m_dX = i;
if(i<2000)
DataPoint.m_dY = i+2;
else
DataPoint.m_dY = (4000-i)+2;
DataPoint.m_sCaption.Format("DataPoint %d", i);
m_wndChart.AddDataPoint(&DataPoint);
}
I will be very happy if this is working.
Thank a lot!!
Originally posted by: martin
that's a very good jao thanks.
I would like to know if it exists a grip chart available to display information ?
Thanks
Martin
Originally posted by: Sergey Pastukhov
The existing BAR_CHART draws 3d chart, it is possible to make it 2d by using mouse and Ctrl key.
Is it possible to draw 2d chart automatically and don't allow rotation?
ReplyOriginally posted by: Ming Delie
Thank the author for giving us such a good job.
I encounter some problem and can not solve it.
In my application, I want to set X axis value from 1 to n with minium step of 1. I add the following datapoints into the series(only one series - TYPE_LINE in my cpp), (x=1,y=...; x=2,y=...;....x=n,y=...).
I also add the following line in my cpp
m_wndChart.SetAxisScale(X_AXIS, 1, 10); // here n = 10
But the result is not like I expected, the resulting chart is still from 0 in X axis(the whole chart image is moved in left direction for one unit), that is to say, the X axis is stil starting from 0, you can even not sign any value to CDataPoint.m_dX, it is still automatically starting from 0.
To my suprise, my code can work correctly in Y axis.
Who can give me some explanation? Thank u very much.
Originally posted by: Jing Li
I have try many times in your demo program and my own
I descover the axis is not start with zero sometimes,
I cant find the reason.
By the way, you did a great job! I hope it will be the
best!
Hello, we4ve got the same problems and modified the _CalculateStats function in DataSeries.cpp At the end (before return) we implement the following source. . . . if(m_dYMin > 0) { m_dYMax += m_dYMin; m_dYMin = 0; } And it works perfect (if you always start with 0) Best regards Manfred Peter Alligator Company Software GmbH http://www.alligatorsql.com
ReplyOriginally posted by: rene
in void CLegendWnd::GetMinimumWindowRect(CRect* pRect)
for (int nRows(1);;nRows++)
Rene
I am happy with graph drawing, but bug, infinite loop still. It is so hard to make it safe in an application as I can't find a way out with the infinite loop when there many X data, longer than the width of the control rect. Get stop in here
{
nNumInRow = nCnt/nRows + nCnt%nRows;
nTotalWidth = nWidth*nNumInRow + nXDelta*(nNumInRow-1);
if (nTotalWidth<m_rcClientRect.Width()) {
int nNumInCol(nCnt/nNumInRow + (nCnt%nNumInRow>0));
nTotalHeight = nHeight*nNumInCol + nYDelta*(nNumInCol-1);
break;
}
}
I will be very happy if this is working.
Originally posted by: Josema
Really, you have done a very hard job (congratulations) but a little unserious (maybe quickly ;-)
There are many warnings if you compile with warning level 4.
One of the more serious warning is in ChartWnd.cpp, line 113 and more.
warning C4706: assignment within conditional expression
This is the piece of code
//if the vertical scaling has changed we need to force
//a complete redraw of the chart, if we are not scrolling
//then we always do a full redraw
if (m_Axis.HasVerticalScalingChanged())
m_bRefreshDisplayCompletely = !(m_bScrolling = FALSE);
Are you really asignating FALSE to m_bScrolling? or maybe you want to compare the variable with FALSE.
Originally posted by: tocsjung
When using RemoveDataPoint to remove a data, Caption region doesn't disappear.
Is this a bug?
Then, How can i fix this problem?
Originally posted by: Rani
i understood how to draw a pie chart. but i want to save as a image file of the pie chart. If you know any article like that, pls guide me
Reply