Currency in chart?

(10 posts) (2 voices)

Tags:

No tags yet.

  1. -nth-, Member

    I'd like to format one of the columns in a chart as currency so that the y axis (vertical) values as well as the values on the chart show a "$". I've tried adding the following command, but didn't see that it made any difference.


    select 'dbr.colstyle', 2,dbo.mydbr_style('$US');

    Is there a different way to accomplish this?

    Thanks!

  2. myDBR Team, Key Master

    You can use native ChartDirector calls to do this:

    select 'dbr.chart.options', 'chartdirector', '$layer->setAggregateLabelFormat("\$ {value}");';
    select 'dbr.chart.options', 'chartdirector','$c->yAxis->setLabelFormat("\$ {value}");';

    --
    myDBR Team

  3. -nth-, Member

    Just ran across a problem when using the aggregate command:


    select 'dbr.chart.options', 'chartdirector', '$layer->setAggregateLabelFormat("\$ {value}");';

    In a report that returns no data, instead of the normal "No data to display" message, I get an error message:
    Fatal error: Call to a member function setAggregateLabelFormat() on a non-object in C:\inetpub\wwwroot\reporting\lib\chart2.php(70) : eval()'d code on line 1

    If I comment out that one line, the report works as expected.

    Thanks,
    -nth-

  4. myDBR Team, Key Master

    When you pass native ChartDirector calls, you should check the data validity. If you know that you your report might not produce data for chart, you can check it first when using native ChartDirector calls. This also gives you an opportunity to replace the generic "No data to display"-message.

    --
    myDBR Team

  5. -nth-, Member

    Would you mind posting an example of a good way to check for data validity? I'm not sure how to go about it in mydbr.

    Thanks,
    -nth-

  6. myDBR Team, Key Master

    If you have a report which might have a situation that a chart element would be empty (no data is returned in chart query), you basically have two options:

    Either let myDBR display the default chart placeholder with text ("No data to display") or take advantage of myDBR's dynamic report creation and check first if the chart data query would returns any rows (using normal count(*) ). If the count is zero, you can leave out the chart altogether or out up a more informative message for user.

    Empty chart data charts no longer invoke the native ChartDirector calls. This has been changed in the latest build.

    --
    myDBR Team

  7. -nth-, Member

    I'm running build 3.0.0 (1195) and am getting the "fatal error" message when my chart contains no data and I've got native chartdirector calls in the report. Am I reading the above message correctly... that this should work (i.e. mydbr should ignore native calls when no data is present to display?)?

    Thanks!

  8. myDBR Team, Key Master

    Yes, this has been corrected in the current builds.

    --
    myDBR Team

  9. -nth-, Member

    OK, it looks like I was behind in updates. I ran the updater and am now at build 1251. Problem is gone!

    I was thinking I had the latest version since the last build mentioned on the update page is 1195.

  10. myDBR Team, Key Master

    We've done some code drops as preparation for upcoming 3.1 release, which is due to ship soon.

    --
    myDBR Team


Reply

You must log in to post.