ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Need Help to Plot 4 Quadrant Chart
Posted by Abhijit on Aug-10-2011 01:15
Attachments:
Hi,

Can anyone tell me how to plot following chart.

I have tried by referring to 4 Quadrant Chart Demo.
But I am missing something in scaling.

My data is generated at run time. there is no limit on Values.

Currently charts shows only quadrant where data is available.
I want all 4 Quadrants visible for any data.
4 Quadrant Chart Expected op.jpg

  Re: Need Help to Plot 4 Quadrant Chart
Posted by Peter Kwan on Aug-11-2011 00:34
Hi Abhijit,

I have just tried the "4 Quadrant Chart" sample code. From my testing, it shows all 4 quadrants even if only one quadrant has data.

Note that the "4 Quadrant Chart" only shows all 4 quadrants if there is at least one point that is not at the (0, 0) origin. If there is no data, or if all data points are at the origin, it will not show all 4 quadrants. If you want it to always show all 4 quadrants, you may add a transparent scatter layer with an artifical point. This is to make sure the chart has at least one data point not at the origin.

For example, in VB/VBScript:

Call c.addScatterLayer(Array(0.001), Array(0.001), "", cd.SquareSymbol, 1, cd.Transparent, cd.Transparent)

If you think the "4 Quadrant Chart" is only showing the quadrant that has data, is it possible to provide a sample code. (You may modify the "4 Quadrant Chart" sample code by using only data that in one quadrant, and see if it does display all 4 quadrants.)

If you are creating a chart with your own code, remember to include the line:

Call c.setAxisAtOrigin(cd.XYAxisAtOrigin, cd.XAxisSymmetric + cd.YAxisSymmetric)

The above line is the line to force all 4 quadrants to display (provided there is at least one point not at the origin).

Hope this can help.

Regards
Peter Kwan

  Re: Need Help to Plot 4 Quadrant Chart
Posted by Abhijit on Aug-11-2011 00:54
Thanks Peter,

I have tried the same to show 4 Quadrant Chart shows all Quadrants irrespective of Data.

Now I need to show colour regions as shown in attached image. I have tried line layer with
interline , bubble chart , etc. to show the region. but i could not achieve the chart.

Can you please suggest..

Thanks and regards,
Abhijit.

  Re: Need Help to Plot 4 Quadrant Chart
Posted by Peter Kwan on Aug-11-2011 02:53
Hi Adhijit,

The yellow zone can be added like:

'add a yellow zone for the region x > -10 and y > -10
Call c.xAxis().addZone(-10, 9999, c.yZoneColor(-10, cd.Transparent, &HFFFF99))

You may repeat the above code for the green and blue zones.

(The red region is the plot area background.)

Hope this can help.

Regards
Peter Kwan

  Re: Need Help to Plot 4 Quadrant Chart
Posted by Abhijit on Aug-11-2011 03:57
Thanks Peter,

your solutions worked like a Charm !!!.

I really appreciate your help.

Many thanks.. :)

Is there any way to give label to quadrant itself.

I want to give label as shown in attached chart.



Thanks and regards,

Abhijit

  Re: Need Help to Plot 4 Quadrant Chart
Posted by Peter Kwan on Aug-11-2011 16:28
Hi Abhijit,

The labels are just static labels at the 4 corners of the plot area. You may use BaseChart.addText to add those labels.

For example:

Call c.addText(c.getPlotArea().getLeftX(), c.getPlotArea().getTopY(), "My Top Left Label", "arial.ttf", 8, &H000000, cd.TopLeft)

Call c.addText(c.getPlotArea().getLeftX() + c.getPlotArea().getWidth(), c.getPlotArea().getTopY(), "My Top Right Label", "arial.ttf", 8, &H000000, cd.TopRight)

.........


Hope this can help.

Regards
Peter Kwan

  Re: Need Help to Plot 4 Quadrant Chart
Posted by Abhijit on Aug-11-2011 17:41
Thanks,

It worked as expected.

I did some calculations to get to the exact location.

But your solution is proper and independent of the label text.

Thanks.


Abhijit