ChartDirector Support Forum Home   Search
Extend Surface After Zooming
Posted by Baris E on Apr-15-2019 21:57
Attachments:
Hello,

I have 3DScatterChart. And I am working on zooming surface chart. I am using C++ surfacechartRotation demo. Now I can zoom in or out to chart by axis scale. After narrowing the scale of the axis a narrower scale is shown so I can see zoomed chart. For zoom out I do opposite of this method. After zoom out I can only see chart that highlighted with green lines. But I want to extend the surface to the boundaries as in the photo. Can you suggest a way for solve this problem?

Thanks.
BE

Re: Extend Surface After Zooming
Posted by Peter Kwan on Apr-16-2019 11:34
Hi Baris E,

From my understand of your enquiry, the attached chart is what you want after zooming out.

After zoom in and then zoom out, does the y-axis show -100 to 100, and the x-axis show 1000-16000? The axis scales are set by your code, so no matter what is displayed, the axis scale should still be those values. Is this the case?

Would you mind to attached a chart image that shows what you see after zooming out?

Regards
Peter Kwan

Re: Extend Surface After Zooming
Posted by Baris E on Apr-16-2019 14:33
Attachments:
Hello Peter,

Range of X-axis and Y-axis changes after mouse wheel move. I attached three chart images and first image is original view, second image is after once zoom out, third image is after twice zoom out. As you can see the surface is center of chart. I want to extend this surface until borders.

Re: Extend Surface After Zooming
Posted by Peter Kwan on Apr-16-2019 19:46
Hi Baris,

In the second chart, I see that the y-axis from -20 to 120, but the data points are from y = 0 to 100. If you want the surface to be from -20 to 120, you would need to provide the data points for y=-20 to y=120. Otherwise ChartDirector cannot draw the surface from y = -20 to 120.

In brief, to extend the surface, you would need to extend your data points.

Regards
Peter Kwan

Re: Extend Surface After Zooming
Posted by Damla B on Apr-20-2019 00:54
Hello Peter,

According to your suggestion, I extend surfaceChart when I do zooming in ( because I you described above, it is not logical to extend it when doing zooming out). For zooming in, I am changing linear scale. Here is my data set;

double dataX[] = { 1000, 2000, 4000, 6000 };
double dataY[] = { 0, 20, 40, 60, 80, 100 };
double dataZ[] = { 0.25, 0.2, 0.15, 0.11,
0.2, 0.18, 0.13, 0.1,
0.19, 0.16, 0.12, 0.095,
0.16, 0.14, 0.11, 0.09,
0.15, 0.12, 0.09, 0.09,
0.15, 0.12, 0.09, 0.09};

I changed surface chart linear scale as it shows below;

surfaceChart.xAxis().setLinearScale(1250,5750);
surfaceChart.yAxis().setLinearScale(10, 90);

However it still shows between (1000,6000) for xAxis and (0,100) for yAxis. Because of the fact that I can not extend my surface chart properly.

Do you have any idea how can set my linear scale as I want ?

Many Thanks,

Re: Extend Surface After Zooming
Posted by Peter Kwan on Apr-20-2019 04:32
Hi Damla,

Please add the following lines as well:

surfaceChart.xAxis().setRounding(false, false);
surfaceChart.yAxis().setRounding(false, false);

In setLinearScale, if your code leaves out the third parameter (the tick increment), ChartDirector may adjust the lowerLimit and upperLimit to the next label position. This ensures the axis starts and ends at a label position. See:

https://www.advsofteng.com/doc/cdcpp.htm#Axis.setLinearScale.htm

For your case, because 1250 is not a label position, it is adjusted to the nearest label position 1000. Similarly, 5750 is adjusted to 6000. If you use Axis.setRounding(false, false), ChartDirector will no longer adjust the axis scale.

Hope this can help.

Regards
Peter Kwan

Re: Extend Surface After Zooming
Posted by Damla B on Apr-24-2019 14:12
Hello Peter,

It helps a lot! Many thanks.