The click event is fired only within the area of the marker as of now. However, you can set markerBorderThickness to a value greater than 0 and markerBorderColor to transparent to increase the area in which the click event is fired without changing the size of the marker.
Please check this JSFiddle for a working example.
—
Thangaraj Raman
Team CanvasJS
Showing fewer datapoints based on the screen size of the device is not available as an inbuilt feature as of now. However, you can achieve the same with a few lines of code. Please check the code snippet below.
var screenWidth = jQuery(window).width();
var dpsCount = 6; //no. of datapoints to be displayed on phone
var dps = [];
if(screenWidth <= 768 ) {
for(var i = 0; i < dpsCount; i++) {
dps.push(chart.options.data[0].dataPoints[i]);
}
chart.options.data[0].dataPoints = dps;
chart.render();
}
Please check this JSFiddle for a working example.
—
Thangaraj Raman
Team CanvasJS
Chart elements may look blurred on changing the zoom level within the display setting of the browser or windows. Resetting the zoom level to 100% should work fine in this case.
—
Thangaraj Raman
Team CanvasJS
We are unable to reproduce the issue at our end, the chart seems to be proper & not blurry. Can you kindly provide more information like the version of CanvasJS & the browser that you are using so that we can try reproducing with the same environment?
—
Thangaraj Raman
Team CanvasJS
Shashi,
For your case, we suggest you to use separate variables for each chart instance or to keep all the chart instances in an array as shown below.
var chartsArray = [];
chartsArray.push(new CanvasJS.Chart("chartContainer1", { //Chart 1 Options }));
chartsArray.push(new CanvasJS.Chart("chartContainer2", { //Chart 2 Options }));
for(var i = 0; i < chartsArray.length; i++) {
chartsArray[i].render();
}
—
Thangaraj Raman
Team CanvasJS.
@avb,
The JSFiddle that you have shared seems to be broken. Could you please share an updated JSFiddle with working code so that we can look into the code/chart options being used, understand the scenario better, and help you out?
Also, we are unable to understand what you mean by center the chart data with a blank space on the right instead of filling till the end. Could you please brief us further with a pictorial representation or an example with the steps to understand your requirement so that we can suggest an appropriate solution?
—
Thangaraj Raman
Team CanvasJS
Changing the cursor while hovering over the underlying area of an area chart is not possible as of now.
—
Thangaraj Raman
Team CanvasJS
You can bind mouse events to the chart container and get mouse coordinates in pixels, which can be converted to corresponding values along the axis using convertPixelToValue as shown in this documentation page. Please take a look at the code snippet below:
jQuery(".canvasjs-chart-canvas").last().on("click",
function(e){
var parentOffset = $(this).parent().offset();
var relX = e.pageX - parentOffset.left;
var xValue = Math.round(chart.axisX[0].convertPixelToValue(relX));
console.log(xValue);
});
—
Thangaraj Raman
Team CanvasJS
Sorting datapoints by x values using the below code snippet seems to be working fine for data-time values as well. Please check this JSFiddle for a working example.
function compareDataPointX(dataPoint1, dataPoint2) {
return dataPoint1.x - dataPoint2.x;
}
If you are still facing issues, kindly create a sample project reproducing the issue and share it with us over Google Drive or OneDrive so that we can look into the code, run it locally to understand the scenario better, and help you out.
—
Thangaraj Raman
Team CanvaSJS
Glad you were able to figure it out. As of now, AJAX call has to be performed separately, and chart options can be updated based on the data fetched from it.
—
Thangaraj Raman
Team CanvasJS
Can you kindly brief us further about your requirement, and share an example or a pictorial representation so that we can understand your scenario better and help you out?
—
Thangaraj Raman
Team CanvasJS
Can you kindly brief us further about your requirement, and share an example or a pictorial representation so that we can understand your scenario better and help you out?
—
Thangaraj Raman
Team CanvasJS
You can set the minimum and maximum properties for axis-y after rendering the chart using the set() method to achieve your requirement.
Please take a look at this updated JSFiddle for a working example.
—
Thangaraj Raman
Team CanvasJS