Passing axis interval as pixel is not possible as of now. However, you can calculate the interval in pixel based on axis bounds and axis range (viewportMinimum and viewportMaximum) as shown in the code snippet below.
chart.axisX[0].set("interval", (chart.axisX[0].viewportMaximum-chart.axisX[0].viewportMinimum)/(chart.axisX[0].bounds.x2-chart.axisX[0].bounds.x1) * intervalInPixel)
Please take a look at this JSFiddle for an example on the same.
—-
Manoj Mohan
Team CanvasJS
Can you please brief us further about your requirement along with a pictorial representation or an example so that we can understand your scenario better and help you out?
—-
Manoj Mohan
Team CanvasJS
vorlontech,
To pass the datapoints variables to html code, you can use json_encode and raw filter of twig. Please take a look at the working code-snippet below.
dataPoints: {{ dataPoints | json_encode(constant('JSON_NUMERIC_CHECK')) | raw }}
—
Manoj Mohan
Team CanvasJS
vorlontech,
The gallery example that you have shared seems to be working fine and we were not able to reproduce the issue at our end. Can you kindly share a complete code over Google-Drive or Onedrive reproducing the issue you are facing so that we can look into your code, run it locally at our end to understand the scenario better and help you out?
—-
Manoj Mohan
Team CanvasJS
CanvasJS is a client-side library and it seems to be working fine with xampp. Please check the error in the browser console or any API which are used to pass the data to the chart.
If you are still facing the issue, kindly create sample project reproducing the issue and share it with us over Google-Drive or Onedrive along with sample data so that we can look into your code, run it locally at our end to understand the scenario better and help you out.
—-
Manoj Mohan
Team CanvasJS
You can render multi-series chart to achieve your requirements. Please take a look at this updated sample project for an example on rendering multi-series chart in PHP with data fetched from database. Also, please refer to this gallery page for an example on multi-series chart in PHP.
—-
Manoj Mohan
Team CanvasJS
Please take a look at this sample project for an example on rendering CanvasJS StockChart in PHP with data from the MySQL database.
—-
Manoj Mohan
Team CanvasJS
Ken,
“canvasjs-commercial-3.8.8/jquery.canvasjs.min.js” is a CanvasJS jQuery Plugin which is used to create CanvasJS chart with jQuery library. To create chart using jQuery plugin, please take a look at this documentation page. In the drilldown example, jQuery library is used to bind the click event and you need to include the library either using CDN link or hosted in your server like “/path/jquery.min.js”. Below code should work fine in your case.
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="canvasjs-commercial-3.8.8/canvasjs.min.js"></script>
—-
Manoj Mohan
Team CanvasJS
It seems like you are loading CanvasJS jQuery plugin instead of jQuery. You can either load jquery from its cdn or from your server by downloading it from this link.
If you are still facing the issue, kindly create sample project reproducing the issue and share it with us over Google-Drive or Onedrive along with sample data so that we can look into your code, run it locally at our end to understand the scenario better and help you out.
—-
Manoj Mohan
Team CanvasJS
It seems like you are loading CanvasJS jQuery plugin instead of jQuery. You can either load jquery from its cdn or from your server by downloading it from this link.
If you are still facing the issue, kindly create sample project reproducing the issue and share it with us over Google-Drive or Onedrive along with sample data so that we can look into your code, run it locally at our end to understand the scenario better and help you out.
—-
Manoj Mohan
Team CanvasJS
Marco,
The behavior is designed such that zooming is limited upto a certain region, so the user doesn’t end up zooming into a blank-region (region with no dataPoints). To zoom into a certain region, there should be a minimum of 3-4 dataPoints.
We will reconsider this behavior for future releases.
___________
Manoj Mohan
Team CanvasJS
As aria-label was set for overlaid canvas instead of the canvas in which charts are drawn, Narrator was announcing it as “Image”. You can add aria-label to canvas and hide the overlaid canvas from the narrator by setting aria-hidden to true as shown in this updated JSFiddle.
—-
Manoj Mohan
Team CanvasJS
As of now, the tooltip is shown based on nearest x-values irrespective of y-values. In order to show tooltip based on y-values in a vertical line chart, you can create line chart and rotate it as shown in this JSFiddle.
—-
Manoj Mohan
Team CanvasJS
@mm,
Thanks for reporting the use-case. It seems like there is an issue with axis labeling when scalebreak is used along with labelAngle and we will fix it in the future releases. Meanwhile, setting labelMaxWidth seems to fix the issue in this scenario. Please take a look at this updated JSFiddle in which labelMaxWidth is set to 100.
—-
Manoj Mohan
Team CanvasJS
Glad the you were able to figure it out based on your scenario :)
—-
Manoj Mohan
Team CanvasJS