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

Message ListMessage List     Post MessagePost Message

  How to make "pivot chart" like excel with Chartdirecotr?
Posted by Jeremy on Aug-05-2015 18:33
Attachments:
Dears,

Does anyone know how to draw a chart like "pivot chart" in excel?

These chart data have such format:

X Group Y
110 50     -0.5
115 50        0
120 50      0.3
114 50        1
120 59        0
124 59     -0.1
128 59     -0.5
180 59     1.2
250 59       1
? ? ?


Which X is the x axis value, y is y axis value, and  "Group" maybe their grouping id.
We may have other subgroup for these data.

Then I use excel to draw chart which will firstly group data with different "Group", and
draw a grouping label under x-axis.


Can chartdirector draw chart likes this?
aaa.png

  Re: How to make "pivot chart" like excel with Chartdirecotr?
Posted by Jeremy on Aug-05-2015 18:36
Attachments:
Bad data format, re-post them again:
data_table.png

  Re: How to make "pivot chart" like excel with Chartdirecotr?
Posted by Peter Kwan on Aug-06-2015 04:01
Hi Jeremy,

First, please try to create a chart with just one row of x-axis labels. This should be just a
simple line chart with symbols and should be easy to create.

To add a second row, one way is to use a "data table". In the sample code "Data Table
(1)", the x-axis contains 4 rows of labels. For your case, you just need add a second row.
You can create cells that span multiple columns by using the CDMLTable.setCell API.

If you can inform me of your programming language, I can try to create a simple example for
you.

Regards
Peter Kwan

  Re: How to make "pivot chart" like excel with Chartdirecotr?
Posted by Jeremy on Aug-06-2015 09:24
Hi Peter ,


Thanks a lot for your reply and info.

I'm using C++ to make this code.



I read the manual about "Data Table" example, the charts are little different from my
case:



1. Can these added column set to different width?
2. Can I added "String" in these CDMLTable?


It will be great if you can give me a simple example.


Thanks,
Jeremy

  Re: How to make "pivot chart" like excel with Chartdirecotr?
Posted by Peter Kwan on Aug-07-2015 01:37
Attachments:
Hi Jeremy,

I have attached an example for your reference. The example includes two different methods
- using CDMLTable, and using BaseChart.addText. In the attached file, the code for the
CDMLTable method is commented out. To try the CDMLTable method, you can uncomment
the code for the CDMLTable method, and comment out the code for the BaesChart.addText
method instead.

Hope this can help.

Regards
Peter Kwan
symbolline2.png
symbolline2.cpp
symbolline2.cpp

3.47 Kb

  Re: How to make "pivot chart" like excel with Chartdirecotr?
Posted by Jeremy on Aug-07-2015 08:59
Hi Peter,

It looks great and exactly what I want :)

I will try it later.

Thanks a lot for your help.


Best regards,
Jeremy