andres,
While echoing a JSON data you are using \"legend\": \"" , $data_points[$i]['legend'],
but the property is legendText so it will be \"legendText\": \"" , $data_points[$i]['legend'],
.
__
Anjali
cristipufu,
Thanks for reporting. We have fixed this issue. Here is an internal build for you. Please let us know if its working as expected.
__
Anjali
cristipufu,
Thanks for reporting. We have fixed this issue. Here is an internal build for you. Please let us know if its working as expected.
__
Anjali
tmacdonald,
This is not possible as of now using valueFormatString. But you can workaround this problem by using label property of dataPoint.
—
Anjali
andres,
You can overcome this issue by either setting the interval to 1 or by using labelAngle property of axisX.
__
Anjali
santu,
Can you please create a jsfiddle with dummy values, so that we can have a look.
__
Anjali
threevaluelogic,
Can you please post the JSON Response (dummy data) so that we can figure out the issue.
__
Anjali
Andres,
I just got it working by using $conn->set_charset(‘utf8’); before fetching the data. Please try with the below code.
$con = mysqli_connect("localhost","dbuser","dbpassword","database");
$conn->set_charset('utf8');
__
Anjali
Hi,
DataPoints with label “11/25” are not at the same position in their respective DataSeries. Hence both are showing their own labels at different positions.
__
Anjali
chanco,
You can call this function inside the onload event handler. Please refer the below code:
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var dataPoints = [{ x: 10, y: 10 },{ x: 20, y: 15 },{ x: 30, y: 25 },{ x: 40, y: 30 },{ x: 50, y: 28 }];
renderMyChart(chartContainer1, dataPoints);
renderMyChart(chartContainer2, dataPoints);
renderMyChart(chartContainer3, dataPoints);
function renderMyChart(theDIVid, myData) {
var chart = new CanvasJS.Chart(theDIVid, {
data: [
{
type: "column",
dataPoints: myData
}
]
});
chart.render();
}
}
</script>
<script type="text/javascript" src="canvasjs.min.js"></script>
</head>
<body>
<div id="chartContainer1" style="width:50%; height:300px"></div>
<div id="chartContainer2" style="width:50%; height:300px"></div>
<div id="chartContainer3" style="width:50%; height:300px"></div>
</body>
</html>
__
Anjali
Chanco,
The first onload event handler is being replaced by the second one and hence only one chart is getting created. Instead of assigning event handler twice, you should create both charts inside the same event handler as shown below.
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer",
{
data: [
{
type: "pie",
indexLabelFontFamily: "Garamond",
indexLabelFontSize: 20,
indexLabelFontWeight: "bold",
startAngle:0,
indexLabelFontColor: "MistyRose",
indexLabelLineColor: "darkgrey",
indexLabelPlacement: "inside",
toolTipContent: "{name}: {y} systems",
showInLegend: true,
indexLabel: "#percent%",
dataPoints: [
{ y: 126, name: "Technical", legendMarkerType: "triangle"},
{ y: 24, name: "Institional", legendMarkerType: "square"},
{ y: 15, name: "Website", legendMarkerType: "circle"}
]
}
]
});
chart.render();
var chart = new CanvasJS.Chart("chartContainer2", {
data: [
{
type: "column",
dataPoints: [
{ label: "End Users", y: 3808 },
{ label: "Servers", y: 427 },
{ label: "Network", y: 618 }
]
}
]
});
chart.render();
}
</script>
<script type="text/javascript" src="canvasjs.min.js"></script>
</head>
<body>
<div id="chartContainer" style="height: 300px; width: 50%;"></div>
<div id="chartContainer2" style="height: 300px; width: 50%;"></div>
</body>
</html>
__
Anjali