I use Chart.js to implement a line chart. The X axis of this diagram has many points, for example an integer range from 1 to 200. Having this many points on the X axis, there is a problem when displaying:
Is it possible to βassembleβ tags so that I can simply show 1, 10, 20? This should only affect the labels and not remove points from the plotted line.
What I did was when creating an array for shortcuts, check if i % 10 === 0 where i is the index of the label, if true, add the label to the array, if false, add an empty string to the array.
i % 10 === 0
i
It may not be the cleanest way, but it works.
Source: https://habr.com/ru/post/976411/More articles:Mongoose - remove element of array of subdocument - javascriptJava8 Lambda performance vs public functions - javaJava Benchmark for a recursive ladder - javaExcluding Grails build size dependency - buildRead to the end of the file with memory formatting in VC ++ - c ++Mappings are incompatible with each other - databaseThe return operation will never be completed. - iosIf the class exists, do something with Javascript - javascriptUIImage and resizableImageWithCapInsets Swift - iosAngularJS - mocking ngTableParams in jasmine test case - javascriptAll Articles