Ngx-charts: Custom xAxis ticks

Created on 1 Feb 2018  路  2Comments  路  Source: swimlane/ngx-charts

I'm submitting a ... (check one with "x")

[ x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior

When using a line chart I have the following values as the x-coordinates in my data: [1, 2, 4, 6, 7, 24, 36, 48]. When logging out the LineChartComponent I see these values as the xSet. However when the graph is rendered I get these values as the ticks on the xAxis: [10, 20, 30, 40].

Expected behavior

I would like to have [1, 2, 4, 6, 7, 24, 36, 48] as the xAxis values. I have tried using the xAxisTickFormatting input but it is not working for me. If I hook a function up to xAxisTickFormatting and log out the value it gets it is those same [10, 20, 30, 40] values. Basically, how do I get the xAxis to have all the x coordinates from my data and not incremental markers?

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Better visualize the data.

Please tell us about your environment:

Windows 10, VS Studio Code, npm

  • ngx-charts version: x.x.x

    7.0.1

  • Angular version: 2.x.x

    4.0.0

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    TS 2.6.1

Most helpful comment

We need this too!

All 2 comments

We need this too!

Merged the PR. This will be in the next release.

Was this page helpful?
0 / 5 - 0 ratings