Please take a look at this sample project on integrating CanvasJS in NodeJS.
—
Vishwas R
Team CanvasJS
that query gives me 5000+ records, divided by 15 minutes in all the records from this year, but the x axis shows me this range
Range of x-axis depends on the dataPoints, if minimum/maximum or viewportMinimum/viewportMaximum are not set. Kindly share JSFiddle with sample data so that we can look into the chart-options you are using, understand the scenario better and help you out.
And when you put the cursor on it, it says “18 Jan 70”, what it means?
Tooltip content is showing 1970 as the timestamp that you are passing to the dataPoints are PHP Timestamp. PHP uses Unix timestamp which is in seconds whereas JavaScript uses milliseconds as timestamp. Converting PHP timestamp to JS timestamp by multiplying PHP timestamp by 1000 should work fine in your case.
—
Vishwas R
Team CanvasJS
Do you mean to show gridlines on top of area chart? If so please take a look at this JSFiddle which shows adding striplines at every interval over axisY to show gridlines on top of columns without reducing the opacity of columns.
If not, can you kindly brief your requirements further, so that we can understand it better and help you out?
—
Vishwas R
Team CanvasJS
You can calculate the dataPoints to the trend-line dynamically by calculating slope as explained in this stackexchange thread. Here is the updated JSFiddle.
One More Question: yValue += Math.round(Math.random() * 10 – 5); What is 10 and 5 here? What we are doing in this formula. Sorry I am new to this.
JavaScript random method returns a floating-point, pseudo-random number in the range 0–1 (inclusive of 0, but not 1). With the help of random method, you can generate a random number between two numbers (lets say you need a number between 0 and 100), which is used in the JSFiddle that’s shared with you.
—
Vishwas R
Team CanvasJS
In the JSFiddle that has been shared, y-values are randomly generated using JavaScript random method. With the help of random method, you can generate a random number between two numbers (lets say you need a number between 0 and 100). You can replace dataPoints in this example with your actual dataPoints and it should work fine.
—
Vishwas R
Team CanvasJS
The data that you are getting from the service is in CSV format which you should parse it to the format accepted by CanvasJS before passing to the chart. Please take a look at our documentation on Creating Chart from CSV Data for step by step tutorial on the same.
—
Vishwas R
Team CanvasJS
Thanks for reporting the issue. Declaring the variable ‘i’ in the getPercentAndTotal method should fix the issue in strict mode. We will fix the same in future releases.
—
Vishwas R
Team CanvasJS
The JSFiddle that you have shared seems to be working fine across browsers including Chrome, Firefox, Opera, Edge and IE. Here is the screenshot of the same.
Can you kindly share the OS details and Browser details like browser name, version, etc so that we can try the same at our end.
—
Vishwas R
Team CanvasJS
Guilherme,
Its not possible to combine Pie, Doughnut, Funnel and Pyramid charts with any other chart-type with axis. Kindly share a pictorial representation of your requirements so that we can understand your use-case better and could try some work-around.
—
Vishwas R
Team CanvasJS
You can add as many charts as you require in a page. To add another chart, you can simply create a container to the chart and render it. Please take a look at this updated JSFiddle. Please take a look at documentation on Rendering Multiple Charts in a Page for step-to-step tutorial on the same.
—
Vishwas R
Team CanvasJS
Guilherme,
Axis labels will be shown at every interval – which is auto-calculated based on parameters like axis minimum, axis maximum, etc. You can change interval to show all labels. In case of date-time axis, set intervalType along with interval according to your requirements.
If you are still facing any issue, kindly create JSFiddle reproducing the issue you are facing and share it with us so that we can look into your code, understand the use-case better and help you out.
—
Vishwas R
Team CanvasJS
Guilherme,
Axis labels will be shown at every interval – which is auto-calculated based on parameters like axis minimum, axis maximum, etc. You can change interval to show all labels. In case of date-time axis, set intervalType along with interval according to your requirements.
If you are still facing any issue, kindly create JSFiddle reproducing the issue you are facing and share it with us so that we can look into your code, understand the use-case better and help you out.
—
Vishwas R
Team CanvasJS