score:1
Accepted answer
i'm not sure why you're having problems, i don't think you should be.
but i have a better answer for you, use buffers instead of heredocs (they're easier to work with anyway)
google ob_start
to learn how it works, they're super useful
ob_start()?>
<script type="text/javascript">
var ctx = document.getelementbyid("mychart").getcontext("2d");
chart.types.bar.extend({
name: "mychart",
initialize: function () {
chart.types.bar.prototype.initialize.apply(this, arguments);
}
});
new chart(ctx).mychart(data, {
scalelabel : "<%= value + ' $' %>"
});
</script>
<?php $chart = ob_get_clean();
echo $chart;
Source: stackoverflow.com
Related Query
- Extend chart.js in PHP heredoc causes parse error
- Unable to parse color in line chart (angular-chart.js)
- Chartjs not rendering chart and no error thrown
- Extend bar chart on Chart JS 2 into a new type of Chart
- Hovering over chart.js values in Meteor onRendered function causes chart axis shift
- Removing chart on click event produces 'removeHoverStyle' of null error
- Configure Pie Chart Colors Using Chart.js and PHP
- Trying to load a chart with chart.js, through ajax and php
- ERROR TypeError: "this.canvas is undefined" | Problem with creating a chart with angular and chart.js
- Grouped Bar Chart from mySQL database using ChartJS and PHP
- Dynamic line chart with chart.js and PHP
- A chart Js error issue are occured in my Laravel other page?
- Chart only prints out first value using jquery ajax php
- Maximum call stack error when attempting to update Chart in Vue js
- How to generate color code dynamically by swapping 2 characters within a string using PHP
- Unexpected error when attempting to update chart data in Chart.js, in a Vue app
- Google Pie Chart php mysql
- create Chart using Chartjs and PHP
- Chart js custom separate legend returns error when clicking legend
- i have an error when use chart on laravel
- web page doesn't display chart or any error
- ChartJS Line chart causes browser crash
- daily activity chart using PHP MySQL
- Chart js PHP and JSON wont diplsay
- How to displays item names from the database using a monthly or yearly chart PHP MySQL
- Chart JS Error : Uncaught TypeError: Cannot read property 'top' of undefined
- Send data from php to chart with ajax
- Dynamically create chart with Chart.js and PHP
- Calling chart JS with PHP Data (file structure)
- Generating different chart results on fly causes flickering
More Query from same tag
- Vuejs - Chart.js wrapper vue3-chart-v2 not displaying labels when data are passed as object
- chart js tooltip how to control the data that show
- Merge 2 charts into 1 chart using update button (chart.js)
- Callback for v-show in vue.js
- JavaScript Chart.JS - Custom tooltips to add description of specific data point when hovering
- Loop Dataset ChartJS Javascript
- impossible to remove scale from radar chart (chart.js)
- How to dynamically change the annotation value in Chart.js
- How to change the color of legend in chartjs and be able to add one more legend?
- Show "No data" in angular-chartjs line graph
- Chart.js Box Annotations Fill Entire Chart
- Type error in using chartjs and tc-angular-chartjs
- Chart.js render problem when routing Angular
- How to use saved data in Ionic/Angular?
- Chart.js - style legend: smaller circles
- Extension for chart.js 2.X
- Using chartJs in a Vue Component and a Webpack cli setup
- Chart JS not working with Dynamic Data
- How to create custom legend in ChartJS
- Why is chart.js not working with angular JS
- Trouble getting Axis Labels to show up in Chart.js
- How to put indicator between yAxis values on yAxis chartJs?
- How to add an extra tick on top of the highest bar in Chart.js v2.9.4 (grace)?
- Remove animation time for chartjs datapoints
- Chart.js angular8 Y axis ticks
- Can't get if else statement in tooltip label to work in chartjs
- custom tooltip opacity always 1
- charts disappear if rendered in hidden divs
- Make pie chart smaller Chart JS
- Chart js - render images on only one dataset