0

I'ved got a line chart like this with date data (not including time)

 new Chartkick.LineChart("chart-2", {"2013-02-10": 11, "2013-02-11": 6});

http://jsfiddle.net/yekLh/1/

why does chartkick always have to include time ? how do i show the series in dates only ?

Axil
  • 3,606
  • 10
  • 62
  • 136
  • 1
    As I understand it, ChartKick uses the Google Visualization API for the actual charts, which will display tick marks for dates based on the range of values presented to the chart. I suspect that in your case, ChartKick is translating your date strings into Date objects, which is why you see this behavior. I don't know how to change ChartKick's behavior, but I know you can get the customization you need if you skip the middleman API and just use the [Visualization API](https://developers.google.com/chart/interactive/docs/quick_start) directly. – asgallant Apr 24 '14 at 04:34

1 Answers1

3

This is the answer, with discrete and hAxis,

http://jsfiddle.net/yekLh/5/

new Chartkick.LineChart("chart-2", 
 {"2013-02-10": 11, "2013-02-11": 6, "2013-02-12": 12, "2013-02-13": 5}, 
{"library":
        {title: "Company Performance",
        "hAxis":{"title":"Date","gridlines":
            {"count":3,"color":"#CCC"},"format":"dd/MM/yy"}}, 
        "discrete": true});
Axil
  • 3,606
  • 10
  • 62
  • 136
  • Hi @Axil, say the time is being displayed at the tooltip alone, is it possible to just customise the tooltip alone and not utilise discrete to be true in this case? Thanks! – Bryan Wong Nov 16 '14 at 08:12