Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (ctx) {
- var jsonData = $.ajax({
- url: 'http://hem.soderquist.nu/inc/temp_7days.php',
- dataType: 'json',
- }).done(function (data) {
- // Split timestamp and data into separate arrays
- //console.log(data);
- var data = [], label = [];
- ctx.height = 130;
- var myChart = new Chart(ctx, {
- type: 'line',
- data: {
- labels: label,
- type: 'line',
- datasets: [{
- data: data,
- label: 'Dataset',
- backgroundColor: 'rgba(255,255,255,.1)',
- borderColor: 'rgba(255,255,255,.55)',
- },]
- },
- options: {
- maintainAspectRatio: true,
- legend: {
- display: false
- },
- layout: {
- padding: {
- left: 0,
- right: 0,
- top: 0,
- bottom: 0
- }
- },
- responsive: true,
- scales: {
- xAxes: [{
- gridLines: {
- color: 'transparent',
- zeroLineColor: 'transparent'
- },
- ticks: {
- fontSize: 2,
- fontColor: 'transparent'
- }
- }],
- yAxes: [{
- display: false,
- ticks: {
- display: false,
- }
- }]
- },
- title: {
- display: false,
- },
- elements: {
- line: {
- borderWidth: 0
- },
- point: {
- radius: 0,
- hitRadius: 10,
- hoverRadius: 4
- }
- }
- }
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement