Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Chart Control
  New Posts New Posts RSS Feed - Is this a bug?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Is this a bug?

 Post Reply Post Reply
Author
Message
kndol View Drop Down
Newbie
Newbie
Avatar

Joined: 30 August 2011
Location: Busan, Korea
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote kndol Quote  Post ReplyReply Direct Link To This Post Topic: Is this a bug?
    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?
 
 
Back to Top
kndol View Drop Down
Newbie
Newbie
Avatar

Joined: 30 August 2011
Location: Busan, Korea
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote kndol Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2011 at 1:20pm
It's my mistake.
I found I miss this. ^^a
pSeries#->SetArgumentScaleType(xtpChartScaleNumerical);
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.