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

Message ListMessage List     Post MessagePost Message

  add multi line chart to multi bar chart
Posted by Volker on Feb-18-2014 17:18
Attachments:
Hello Peter,

i would like to add to a multi bar chart a multi line chart which shows for each multipe bar the belonging line chart value.

When I add a new dataset for the multi line chart it creates me only a new line per "bar chart group".

Is it possible to also add a multi line chart to the multi bar chart?

Example:

a multi bar chart with 4 bars in four different groups = 16 Values

I would like to have also a multi line chart on the y2 axis for these 16 values (see attached screenshot)

Thanks
Volker
chart.JPG

  Re: add multi line chart to multi bar chart
Posted by Volker on Feb-18-2014 20:10
Peter,

here is also my sample code:


First I've created a multiple bar chart:

    $layer = $c->addBarLayer2(Side, 4);
    $data0 = array(1,2,3,4);
    $layer->addDataSet($data0, 0x1F497D, "Target 2013");
    $data0 = array(2,2,3,5);
    $layer->addDataSet($data1, 0x8DB4E2, "Actual 2013");

Then I've tried to add the beloning target values for each bar chart value as a line chart

$layer = $c->addLineLayer2(Side,4);
$plan_array = array(2,4,3,1);
$layer->addDataSet( $plan_array, 0xc00000, "EBIT 2013 in %");
$plan_array2 = array(3,4,5,2);
$layer->addDataSet( $plan_array2, 0xc00000, "ACTUAL EBIT 2013  in %");

  Re: add multi line chart to multi bar chart
Posted by Peter Kwan on Feb-19-2014 00:48
Hi Volker,

May be you can try to use Layer.alignLayer. It is like:

#Bar layer as usual
$barLayer = $c->addBarLayer2(Side, 4);
$data0 = array(1,2,3,4);
$layer->addDataSet($data0, 0x1F497D, "Target 2013");
$data1 = array(2,2,3,5);
$layer->addDataSet($data1, 0x8DB4E2, "Actual 2013");

#The lines
$plan_array = array(2,4,3,1);
$layer = $c->addLineLayer($plan_array, 0xc00000, "EBIT 2013 in %");
$layer->alignLayer($barLayer, 0);  #align line with data set 0 of $barLayer
$plan_array2 = array(3,4,5,2);
$layer = $c->addLineLayer($plan_array2, 0xc00000, "ACTUAL EBIT 2013  in %");
$layer->alignLayer($barLayer, 1);  #align line with data set 1 of $barLayer

Hope this can help.

Regards
Peter Kwan