Search code examples
dygraphs

dygraph: how to have string values in x-axis


I have requirements like plotting a graph for 'salesman wise sales', 'department-wise income ' etc... When I try giving string values in x-axis i am getting errors like below.

Couldn't parse Ahmed as a date

please help.


Solution

  • The values other than date or float are prohibited for x-values. See Data Format. However you may put your string values in an array and use indexes instead of actual string values.

    See xValueParser, valueFormatter and axisLabelFormatter as well.