Chartdirector - Major/minor ticks - Parse error

(6 posts) (2 voices)
  1. ajdjackson, Member

    Hi

    I'm trying to set the major and minor tick marks for a bar chart. I need the x-axis ticks and labels to be 0,1,2,3,4.... .
    At present I'm getting 0,0.5,1,1.5,2 ..... I need to remove the .5 ticks.

    the basic code:

    select 'dbr.chart', 'Bar', 'Expected Handovers'; SELECT 'dbr.chart.options', 'imagechart'; select 'dbr.chart.options','chartdirector', '$c->xAxis->setLabelStep(1,0)';

    select monthname(a.Plot_ExpHOD), count(a.tblContractXIDJobNo) as '[Val]' from hilmark.tblsitesplotsjake a join hilmark.tblsitesjake b on a.Site_ID = b.Site_ID where year(a.Plot_ExpHOD) = year(current_date) and a.tblContractXIDJobNo not in (select tblSalesInv_XIDJob from hilmark.tblsalesinv_j) and a.Site_ID = 4 group by month(a.Plot_ExpHOD);

    When I add the following select 'dbr.chart.options','chartdirector', '$c->xAxis->setLabelStep(1,0)';

    I get the following error:

    Parse error: syntax error, unexpected $end in C:\Program Files\Windows Server\Bin\WebApps\Site\mydbr\lib\chart2.php(183) : eval()'d code on line 1 Parse error: syntax error, unexpected $end in C:\Program Files\Windows Server\Bin\WebApps\Site\mydbr\lib\chart2.php(183) : eval()'d code on line 1

    Any thoughts?

    Thanks

    Jake

  2. myDBR Team, Key Master

    Try with semicolon:

    select 'dbr.chart.options','chartdirector', '$c->xAxis->setLabelStep(1,0);';

    --
    myDBR Team

  3. ajdjackson, Member

    Hi

    That stopped the parse error but I'm still getting 0,0.5,1,1.5,2....

    How do I get 0,1,2,...

    Thanks

    Jake

  4. myDBR Team, Key Master

    Run the updater to get the latest build and use command:

    select 'dbr.chart.options','chartdirector', '$c->yAxis->setLinearScale(0,4,1,0);';

    The bar chart is a 90° rotated column chart, hence the use of yAxis.

    --
    myDBR Team

  5. ajdjackson, Member

    Hi

    Sorry for the delay in getting back - I was off for a couple of weeks :)

    The above worked but I see that you have to specify the max axis value, 4 in this example. Is there a way to pass a variable to set that value?

    Cheers

    Jake

  6. myDBR Team, Key Master

    Jake,
    You can use CONCAT the command to pass a variable:

    select 'dbr.chart.options','chartdirector', concat('$c->yAxis->setLinearScale(0,',v_max,',1,0);');

    --
    myDBR Team


Reply

You must log in to post.