Chart seems to be rendering with 3 dataseries but datapoints passed to the chart seems to be empty. Also, we observed that you are using older version of CanvasJS. Kindly download the latest version of CanvasJS Charts from our download page.
If the issue still persists, kindly create a JSFiddle with sample data reproducing the issue you are facing and share it with us so that we can look into the code, understand the scenario better and help you resolve it.
—
Vishwas R
Team CanvasJS
It’s not possible to display indexlabels both inside & outside in pie chart, as of now.
—
Vishwas R
Team CanvasJS
Please take a look at this Gallery Page for an example on rendering chart inside jQuery modal.
If you are still facing issue, kindly create JSFiddle reproducing the issue you are facing and share it with us so that we can look into the code, understand the scenario better and help you out.
—
Vishwas R
Team CanvasJS
You can zoom either horizontally, vertically or both by setting zoomType property. You can try setting zoomType: "y"
to zoom vertically. Please refer to our documentation for more customization options available.
—
Vishwas R
Team CanvasJS
Based on the link that you have shared, zoomEnabled property is set at stockchart level instead of chart level. Setting it at chart level (in RSI chart) should work fine in your case. Please find the code-snippet below.
var rsiDPS = calculateRSI(data);
stockChart.addTo("charts", {height: 100, zoomEnabled: true, axisY: [{minimum: 0, maximum: 100, stripLines:[{value:30}, {value: 70}]}],data: [{type: "line", name: "Relative Strength Index (RSI)", showInLegend: true, yValueFormatString: "00", dataPoints: rsiDPS}], legend: {horizontalAlign: "left"}});
—
Vishwas R
Team CanvasJS
Glad that you figured it out :)
Yes, as you have mentioned setting toolTipContent to null will hide information related to that particular dataseries from the tooltip.
—
Vishwas R
Team CanvasJS
You can enable zooming in chart by setting zoomEnabled property to true. Please take a look at ‘Behavior of Zoom / Pan’ section in this documentation page for more information along with example.
—
Vishwas R
Team CanvasJS
Pushing datapoint values to different arrays & passing them in multi-series chart options should work fine in this case. Please find the code snippet below.
<?php
$dataPoints1 = array();
$dataPoints2 = array();
$con=mysqli_connect("localhost","root","","test"); //mysqli_connect("host","username","password","db"); - Refer https://www.w3schools.com/php/func_mysqli_connect.asp for more info
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="SELECT xval,yval1, yval2 FROM datapoints";
if ($result=mysqli_query($con,$sql)){
foreach($result as $row){
array_push($dataPoints1, array("x"=> $row["xval"], "y"=> $row["yval1"]));
array_push($dataPoints2, array("x"=> $row["xval"], "y"=> $row["yval2"]));}
}
mysqli_close($con);
?>
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
exportEnabled: true,
theme: "light1", // "light1", "light2", "dark1", "dark2"
exportEnabled: true,
title:{
text: "PHP Column Chart from Database - MySQLi"
},
data: [{
type: "column", //change type to bar, line, area, pie, etc
dataPoints: <?php echo json_encode($dataPoints1, JSON_NUMERIC_CHECK); ?>
}, {
type: "column", //change type to bar, line, area, pie, etc
dataPoints: <?php echo json_encode($dataPoints2, JSON_NUMERIC_CHECK); ?>
}]
});
chart.render();
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 360px; width: 50%; margin: auto;"></div>
<script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
</body>
</html>
—
Vishwas R
Team CanvasJS
Y-value supports numbers as of now. However, if you like to show it as ‘100 INR’ in the tooltip, you can try setting yValueFormatString to “#,### INR”. To do the same thing in axis-labels, you can set valueFormatString property.
If you are looking for something else, kindly share your requirements so that we can understand it better and guide you accordingly.
—
Vishwas R
Team CanvasJS
Jim Ginn,
Axis range depends on multiple factors like y-values of dataseries attached, other chart-options like includeZero, interval, minimum, maximum, etc. In your case, multiple dataseries are attached to secondary y-axis that includes range of values from 0.18 to 281. Hence, auto calculated axis minimum includes a negative interval. Setting minimum: 0
should remove negative values in this case.
—
Vishwas R
Team CanvasJS
Chris Trigg,
Glad that you figured it out :)
Thanks for bringing this to our notice, we have updated our documentation accordingly.
When updateChart
parameter is passed as true, it updates the chart automatically after removing dataseries. And it doesn’t when it’s passed as false. Please refer to this documentation page for more info along with live example.
—
Vishwas R
Team CanvasJS
Rendering bar chart with positive & negative values seems to be working fine. Can you kindly create JSFiddle reproducing the issue you are facing & share it with us, so that we can look into the code / chart-option being used by you, understand the scenario better and help you out?
From what we have observed, sometimes things get delayed mostly when we are not able to reproduce the issue or not able to understand the exact scenario, or the solution that we provide may not work properly at your end due to variation in the chart-options being used by you and us. Having a JSFiddle with sample data helps us in figuring out the issue and suggesting an appropriate solution accordingly.
—
Vishwas R
Team CanvasJS
Can you kindly create JSFiddle reproducing the issue you are facing & share it with us so that we can look into it, understand the scenario better and help you out? We are unable to reproduce the issue as values of xAxis, secXAxis
are not known.
—
Vishwas R
Team CanvasJS