KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Date/DateTime type for horizontal axis on Google ColumnChart not continuous, even possible? #718

Open Adam Lehman opened this topic on on Mar 1, 2019 - 7 comments

Adam Lehman commented on Mar 1, 2019

I am trying to make a Column Chart with dates on the horizontal axis, and number of sales on that day on the vertical axis, and would like the chart to be continuous, as described in Google's docs here, https://developers.google.com/chart/interactive/docs/customizing_axes#Discrete_vs_Continuous. This offers me potential benefits such as time specific gaps that otherwise would jump from one sale to the next sale whatever day that might be, and it offers me the potential for easy scrolling using the explorer option as described here, https://developers.google.com/chart/interactive/docs/gallery/columnchart in the "Configuration options" section of the page. I have found that the number type for the horizontal axis can produce a continuous Column Chart, but I cannot figure out how to do it with dates or datetimes. Any help would be much appreciated, thank you.

KoolReport commented on Mar 1, 2019

For the column for your date, please add "type":

ColumnChart::create(array(
    "myDateColumn"=>array(
        "type"=>"date",
    ),
    ..
))
Adam Lehman commented on Mar 1, 2019

I have done that, it does not make the chart continuous for date or datetime.

Andrew Borell commented on Mar 1, 2019

Does your date field by chance have null values? In a line chart you can use the interpolateNulls: true option, but I dont think this is available for column charts. I suspect this could cause problems in a column chart scenario, but I haven't any time to test that this afternoon.

Adam Lehman commented on Mar 1, 2019

There are no nulls in my data set, no.

KoolReport commented on Mar 2, 2019

We will look into this to find the issue. It would be nice to have the continuous drawing. So far from what I see, google chart will not understand the datetime in string format, we need to input explicitly. Anyway I have told the dev.team to work on this. We will keep you update.

Adam Lehman commented on Apr 2, 2019

Thank you for your help. I look forward to hearing any updates you might have.

Toby Beresford commented on Jul 4, 2019

+1

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None