Time column

(3 posts) (2 voices)
  1. superuser, Member

    Hello,

    I'm evaluating myDBR right now and so far, it's been pretty good. I'm having some small trouble with representing duration value that is stored in a MySQL TIME column.

    In my repot data table, which is done through a simple select, the duration has "am" or "pm" appended to it because myDBR recognizes it as time. Since it's a duration, I don't want to have am or pm, how do I get rid of that?

    A similar problem with a chart, if I simply plot my chart as:

    select if(dayofweek(date_checked)=2,date_checked,'') date_check, duration from db_data.sample;

    There is nothing on the chart and Y axis has NaN labels. I can convert time to seconds with time_to_sec() but it's pretty incovenient and I'd rather see times on the chart and the Y axis. Is there a way to do it using Flash charts?

    Thanks!

  2. superuser, Member

    Ok, I managed to solve the first issue by defining a new style called DurationStyle with the following definition: %s;%s;%s and then using this style on the data table through

    select 'dbr.colstyle', 'Duration', mydbr_style('DurationStyle');

    Still struggling with the charting issue.

  3. myDBR Team, Key Master

    When using time as duration instead of time, you can use colstyle 'hh:mm:ss' / 'mm:ss' . This makes myDBR to treat the column as duration which keeps the formatting as defined in the column and also in summary.

    Flash charts are not that capable. When you use image-charts, times/durations are fully supported.

    --
    myDBR Team


Reply

You must log in to post.