Hi
Im using Tchart version 5.0.6.0, VC++ 6.0. Im getting an exception fired in debug mode, if I
1) Create a bar chart
2) Turn on color each point
3) Open the editor dialog and select the Data tab.
Note* This only happends when the color each point property is set to true.
I think theres an exception fired somewhere, probably when the it tries to fill in the data in the color column of the data table. I have not tried this in relase mode, so Im not sure if its isolated to debig only.
Heres my code snippet
const xercesc::DOMElement* elem = someXmlelement
vector<double> x;
vector<double> y;
create2Ddata(elem,x,y);
assert(x.size() == y.size());
int id = chartCtrl->AddSeries(scBar);
//horiz line is derived from line, so we can set style on line
//for both types
CBarSeries barChart = chartCtrl->Series(id).GetAsBar();
//get the percent width of the bars from xml file
//this will be first child of current element node
XMLCh* val;
wchar_t** stopStr = 0;
ChartUtils::getFirstChildNode(elem,ChartXmlString::percentBarWidthStr(),val);
double barWidth = 50;
if(val) barWidth = wcstod(val,stopStr);
//set bar width. Clip width to deal with roundoff
if(barWidth < 0.0) barWidth = 0.0;
if(barWidth > 100.0) barWidth = 100.0;
barChart.SetBarWidthPercent(barWidth);
//set style of bar chart to rectangular gradient
barChart.SetBarStyle(bsRectGradient);
//disable repaint while adding data.
chartCtrl->SetAutoRepaint(FALSE);
int len = x.size();
for(int i=0; i<len; ++i)
{
chartCtrl->Series(id).AddXY(x,y,"",clTeeColor);
}
//turn off marks on top of bars
chartCtrl->Series(id).GetMarks().SetVisible(FALSE);
chartCtrl->Series(id).SetColorEachPoint(TRUE);
//reactivate autorepaint and repaint
chartCtrl->SetAutoRepaint(TRUE);
chartCtrl->Repaint();
Crash in bar chart
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi -
Could you please modify the above example, or send me a simple project (chris@steema.com) that I can run "as-is", so that I can reproduce the problem here?
Many thanks.
I'm afraid I'm having diffculty reproducing this one here with TeeChart AX v5.0.6.0 and a simple MFC exe VC++6.0 project. Following is the code I'm using:Note* This only happends when the color each point property is set to true.
I think theres an exception fired somewhere, probably when the it tries to fill in the data in the color column of the data table. I have not tried this in relase mode, so Im not sure if its isolated to debig only.
Code: Select all
void CVCplus6AXv5Dlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
m_Chart1.AddSeries(scBar);
m_Chart1.SetAutoRepaint(FALSE);
for(double i =0; i < 20; ++i) {
m_Chart1.Series(0).AddXY(i, rand() * 100, "", clTeeColor);
}
m_Chart1.Series(0).SetColorEachPoint(TRUE);
m_Chart1.Series(0).GetMarks().SetVisible(FALSE);
m_Chart1.SetAutoRepaint(TRUE);
m_Chart1.Repaint();
}
void CVCplus6AXv5Dlg::OnButton1()
{
m_Chart1.ShowEditor(0);
}
Many thanks.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Ill will try and create a simple example, to replicate the problem. In the mean while, I can get this to happen if with teechart 5 demo.
welcome->New Features->Chart->Axes->Labels->Milleseconds.
Select the editor dialog, select series tab then select color each checkbox. Pick the data Tab on the main dialog
welcome->New Features->Chart->Axes->Labels->Milleseconds.
Select the editor dialog, select series tab then select color each checkbox. Pick the data Tab on the main dialog
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi -
to:
This problem also occurs in TeeChart AXv6 and as such I have added it to our list of defects.
No, that's alright, I've got it now. This appears to be a defect that occurs when the series XValues are outside of the range produced by the FillSampleValues method (i.e. if the XValues are anything other than 0, 1, 2, 3, 4 etc.). For example, I can make the code example I sent you fall over by changing:Ill will try and create a simple example, to replicate the problem. In the mean while, I can get this to happen if with teechart 5 demo.
Code: Select all
for(double i =0; i < 20; ++i) {
m_Chart1.Series(0).AddXY(i, rand() * 100, "", clTeeColor);
}
Code: Select all
for(double i =1; i < 20; ++i) { //changed from 0 to 1
m_Chart1.Series(0).AddXY(i, rand() * 100, "", clTeeColor);
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/