Michael,
You can achieve this with the help of axis labelFormatter and formatNumber(). Please take a look this jsfiddle.
—
Vishwas R
Team CanvasJS
Just like having DOM in a website/web-app, you can create a DOM for chart-container in html and script-part goes inside js/ts (based on your usage) files. Please take a look at this tutorial on Building Mobile App with Angular & Ionic. Also please refer this tutorial on Ionic.
—
Vishwas R
Team CanvasJS
Pavlo,
Thanks for your feedback. We will consider this behaviour for future releases.
—
Vishwas R
Team CanvasJS
It seems to be working fine. Can you kindly share sample project over Onedrive or Google-Drive so that we can look into your code, understand your scenario better and help you out?
Please find the screenshot below:
—
Vishwas R
Team CanvasJS
You can save CanvasJS file (canvasjs.min.js) in src folder of your project (‘src/assets/js’ or ‘src/lib’) and import the CanvasJS library to your app using import CanvasJS from 'canvasjs.min'
(path may vary based on file location like ‘./src/assets/js/canvasjs.min’ or ‘./src/lib/canvasjs.min’). Or you can add it in your html file using script-tag. Please take a look at this ionic documentation on Adding 3rd Party Libraries.
Also please refer this tutorial on How to Install 3rd Party Libraries in Ionic 2 and step-by-step guide given in this github thread for more info.
—
Vishwas R
Team CanvasJS
Paul,
Its not a bug but its due to invalid x-value that has been passed to chart. moment().startOf('d')
is not a valid JavaScript date-time object, however moment().startOf('d')._d
is valid date-time object. Passing valid date-time object should work fine in your case. Please take a a look at this updated jsfiddle.
—
Vishwas R
Team CanvasJS
You can pass image width and height parameters to addImage method of jsPDF to handle clipping of chart while exporting it as PDF. Please refer to jsPDF documentation for more information on the same. Below is the code-snippet with width & height parameters.
var dataURL = canvas.toDataURL();
var pdf = new jsPDF();
pdf.addImage(dataURL, 'JPEG', 20, 20, 170, 80); //addImage(image, format, x-coordinate, y-coordinate, width, height)
pdf.save("download.pdf");
Please take a look at this updated JSFiddle for complete code.
—
Vishwas R
Team CanvasJS
Can you kindly share sample project along with sample data over Google-drive or Onedrive so that we can look at your code, understand it better and help you out?
—
Vishwas R
Team CanvasJS
Bimal,
The behaviour is designed so that toolTip is shown based on nearest x-values irrespective of y-values and chart-type. However toolTip will be shown only when you hover on column when its not shared.
—
Vishwas R
Team CanvasJS
Bimal,
We observe that the toolTIp gets hidden while panning the chart. Can you kindly create jsfiddle reproducing the issue so that we can understand your scenario better and help you out?
—
Vishwas R
Team CanvasJS
rangeChanging and rangeChanged are triggered everytime when viewportMinimum or viewPortMaximum are updated while zooming, panning, or reset. If you like to perform some task within rangeChanging/rangeChanged for custom range, you can add a condition to check the range before the actual functionality.
rangeChanging: function(e) {
if(e.axisX[0].viewportMinimum > customRangeMinimum && e.axisX[0].viewportMaximum < customRangeMaximum) {
//Your code goes here
}
}
—
Vishwas R
Team CanvasJS
You can perform data filtering based on range of zoomed region with the help of rangeChanging event. Initially you can read all data using AJAX and pass it to chart. Based on range of zoomed-region, you can filter the datapoints upon zooming. Below is the code snippet.
if (e.trigger === "zoom") {
chart.options.data[0].dataPoints = [];
if (((e.axisX[0].viewportMaximum - e.axisX[0].viewportMinimum) / hours) < 1) {
for (var i = 0; i < dps.length; i++) {
chart.options.data[0].dataPoints.push(dps[i]);
}
} else if (((e.axisX[0].viewportMaximum - e.axisX[0].viewportMinimum) / (hours)) < 24) {
for (var i = 0; i < dps.length; i += 10) {
chart.options.data[0].dataPoints.push(dps[i]);
}
}
}
Please take a look at this JSFiddle for an working example on the same.
moving the code to rangeChanged function it seems the chart is not render properly and i don’t understand why
In the JSFiddle that you have shared, you are generating new dataPoints with x-value as date-time which is outside the range you have zoomed. Because of this you may find chart to be blank after zooming into a certain region – without any dataPoints.
—
Vishwas R
Team CanvasJS
Due to security reasons mail-clients doesn’t support JavaScript in mail. Due to this, its not possible to embed charts in the mail. However you can export chart as an image and embed image in the mail.
—
Vishwas R
Team CanvasJS
We have just released v2.1.2 with this bug fix. Please refer to the release blog for more information. Do download the latest version from our download page and let us know your feedback.
—
Vishwas R
Team CanvasJS