Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Chart Control
  New Posts New Posts RSS Feed - How to change Chart Axis
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to change Chart Axis

 Post Reply Post Reply
Author
Message
Jing View Drop Down
Groupie
Groupie


Joined: 14 February 2011
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jing Quote  Post ReplyReply Direct Link To This Post Topic: How to change Chart Axis
    Posted: 11 March 2011 at 3:49pm
I am new to ChartPro. I want to change x and y axis range of one graph.
I use the following code:
CXTPChartAxisRange* pRange = pAxisY->GetRange();pRange->SetViewAutoRange(FALSE);  pRange->SetViewMinValue(dYmin);pRange->SetViewMaxValue(dYmax);
similiarly to X axis. But I didnot get what I want to restrict x axis between dXmin and dXmax, and restrict y axis between dYmin and dYmax. Is there anything I should change?
 
Thanks!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2011 at 4:26pm
you need SetAutoRange(FALSE),  GetMinValue/GetMaxValue instead.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Jing View Drop Down
Groupie
Groupie


Joined: 14 February 2011
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jing Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2011 at 4:36pm

I think you mean SetAutoRange(FALSE), SetMinValue/SetMaxValue right? definitely not get. I tried that, it is not working. It changes my y axis to between dYmin and dYmax, but didn't change x axis to between dXmin and dXmax.

Back to Top
Jing View Drop Down
Groupie
Groupie


Joined: 14 February 2011
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jing Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2011 at 4:49pm

Another question is how I can control the numbers shown under the axis. For example, the x axis range is from 1 to 10. I want it show like 2,4,6,8,10. How can I control that?

Back to Top
Jing View Drop Down
Groupie
Groupie


Joined: 14 February 2011
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jing Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2011 at 5:27pm
Smile find the solution.
Oleg, I think the problem for my question is solved. I added the following, then it works fine. Thank you!

pSeries->SetArgumentScaleType(xtpChartScaleNumerical);

 
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 21 March 2011 at 9:27am

I'm very sorry to say, but I'm totally lost specifying the axis range? And no documentation?

  • What is the difference between SetViewAutoRange and SetAutoRange for an axis?
  • Why has SetMinValue and SetMaxValue no effect at all?
  • Should I also set SetViewMinValue and SetViewMaxValue?
  • Can I change between different ranges after adding data?
  • Sometimes I get a small scrollbar on the graph, how do I control that?

-cpede

 
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2011 at 5:34am
Ok, now I just figured out that auto range has no effect on CXTPChartFastLineSeriesStyle. Probably make sense, but an assertion would have been in place.
 
On the other hand I cannot turn antialiasing off for CXTPChartScatterLineSeriesStyle.
 
-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
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.188 seconds.