Print Page | Close Window

Is this a bug?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18879
Printed Date: 04 December 2024 at 10:17pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Is this a bug?
Posted By: kndol
Subject: Is this a bug?
Date Posted: 30 August 2011 at 12:34pm
 
I used data with different x value among series.
Then I found the chart control didn't display correctly.
In example, I changed some x axis data of the ChartBrowser sample code. (CLineView class)
 

  CXTPChartSeries* pSeries1 = pCollection->Add(new CXTPChartSeries());
  if (pSeries1)
  {
   pSeries1->SetName(_T("New York"));
   CXTPChartSeriesPointCollection* pPoints = pSeries1->GetPoints();
   if (pPoints)
   {
    CXTPChartSeriesPoint* pPoint = NULL;
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1900, 7268));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1950, 14830));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1990, 17990));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(2000, 18976));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(2008, 19490));
   }
   pSeries1->SetStyle(new CXTPChartLineSeriesStyle());
  }
  CXTPChartSeries* pSeries2 = pCollection->Add(new CXTPChartSeries());
  if (pSeries2)
  {
   pSeries2->SetName(_T("California"));
   CXTPChartSeriesPointCollection* pPoints = pSeries2->GetPoints();
   if (pPoints)
   {
    CXTPChartSeriesPoint* pPoint = NULL;
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1900, 1485));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1950, 10586));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1990, 29760));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(2000, 33871));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(2008, 36756));
   }
   pSeries2->SetStyle(new CXTPChartLineSeriesStyle());
  }
  CXTPChartSeries* pSeries3 = pCollection->Add(new CXTPChartSeries());
  if (pSeries3)
  {
   pSeries3->SetName(_T("Florida"));
   CXTPChartSeriesPointCollection* pPoints = pSeries3->GetPoints();
   if (pPoints)
   {
    CXTPChartSeriesPoint* pPoint = NULL;
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1900, 528));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1950, 2771));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1990, 12937));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(2000, 15982));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(2008, 18328));
   }
   pSeries3->SetStyle(new CXTPChartLineSeriesStyle());
  }
  CXTPChartSeries* pSeries4 = pCollection->Add(new CXTPChartSeries());
  if (pSeries4)
  {
   pSeries4->SetName(_T("Texas"));
   CXTPChartSeriesPointCollection* pPoints = pSeries4->GetPoints();
   if (pPoints)
   {
    CXTPChartSeriesPoint* pPoint = NULL;
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1925, 3048));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1976, 7711));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(1993, 16986));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(2005, 20851));
    pPoint = pPoints->Add(new CXTPChartSeriesPoint(2011, 24326));
   }
   pSeries4->SetStyle(new CXTPChartLineSeriesStyle());
  }
 
I changed blue colored texts from original code. Then chart control displayed below:
 
 
I want to display these data correctly. How can I do?
 
 



Replies:
Posted By: kndol
Date Posted: 30 August 2011 at 1:20pm
It's my mistake.
I found I miss this. ^^a
pSeries#->SetArgumentScaleType(xtpChartScaleNumerical);



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net