Friday, 15 April 2011

javascript - Highcharts chart not showing in IE9 -



javascript - Highcharts chart not showing in IE9 -

i have made time series chart highcharts.

it works fine ff, doesnt run in ie9. probleme here?

http://jsfiddle.net/sbra/tcfju/

full code on jsfiddle: snippet here:

$(function () { $(document).ready(function() { var jsdata = json.parse('{"data":[{"datetime":1035151200001,"value":0.737},{"datetime":1358722800001,"value":1.374},{"datetime":1359327600001,"value":1.374},{"datetime":1360537200001,"value":1.38}]}'.valueof()); console.log(jsdata); var chartdata = []; (i in jsdata.data) { chartdata.push( [ new date(jsdata.data[i].datetime).gettime(), jsdata.data[i].value ] ); } chart = new highcharts.chart({ chart: { renderto: 'tsc_chartdiv', zoomtype: 'x', spacingright: 20, spacingleft: 20, marginleft: 200 }, title: { text: 'xyz' }, subtitle: { text: document.ontouchstart === undefined ? 'click , drag in plot area zoom in' : 'drag finger on plot zoom in' }, credits: { text: '-.com', href: '' }, xaxis: { type: 'datetime', maxzoom: '1209600000', // 14 days title: { text: null } }, yaxis: { title: { text: '' }, plotbands: [{ color: 'rgba(253, 195, 156, .6)', from: 1.5, label: { text: 'high' }, to: 1000}, { from: 1.4, label: { text: 'normaal' }, to: 1.5}, { color: 'rgba(196, 243, 112, .6)', from: 0, label: { text: 'low' }, to: 1.4}], showfirstlabel: false }, tooltip: { shared: true }, legend: { enabled: true }, plotoptions: { area: { fillcolor: { lineargradient: { x1: 0, y1: 0, x2: 0, y2: 1}, stops: [ [0, highcharts.getoptions().colors[0]], [1, 'rgba(2,0,0,0)'] ] }, linewidth: 1, marker: { enabled: false, states: { hover: { enabled: true, radius: 5 } } }, shadow: false, states: { hover: { linewidth: 1 } }, threshold: null } }, series: [{ type: 'area', name: 'xyz', data: chartdata }] }); var startx = 0; var starty = 20; var roundedval = 0; chart.renderer.text('index (i) Änderung:', startx + 20, starty + 20).add(); roundedval = (math.round(parsefloat("0.004366812227074135")*1000)/10).tofixed(1); console.log(roundedval); if (roundedval >= 0.1) { chart.renderer.image("images/chart/up.png", startx + 20, starty + 40, 50, 50).add(); } else if (!(roundedval>=-0.1)) { chart.renderer.image("images/chart/down.png", startx + 20, starty + 40, 50, 50).add(); } else { chart.renderer.image("images/chart/equal.png", startx + 20, starty + 40, 50, 50).add(); } chart.renderer.text(roundedval + "%", startx + 100, starty + 75).css({ fontweight: 'bold', fontsize: '20px', }).add(); chart.renderer.text('i-aktuell:', startx + 20, starty + 120).add(); roundedval = (math.round(parsefloat("1.38")*1000)/1000).tostring(); chart.renderer.text(roundedval, startx + 20, starty + 160).css({ fontweight: 'bold', fontsize: '30px', }).add(); chart.renderer.text('i-zuletzt:', startx + 20, starty + 200).add(); roundedval = (math.round(parsefloat("1.374")*1000)/1000).tostring(); chart.renderer.text(roundedval, startx + 100, starty + 200).add(); chart.renderer.text('i-höchst:', startx + 20, starty + 220).add(); roundedval = (math.round(parsefloat("1.466")*1000)/1000).tostring(); chart.renderer.text(roundedval, startx + 100, starty + 220).add(); chart.renderer.text('i-tiefst:', startx + 20, starty + 240).add(); roundedval = (math.round(parsefloat("0.685")*1000)/1000).tostring(); chart.renderer.text(roundedval, startx + 100, starty + 240).add(); chart.renderer.text('i-avg:', startx + 20, starty + 260).add(); roundedval = (math.round(parsefloat("1.0567862745098051")*1000)/1000).tostring(); chart.renderer.text(roundedval, startx + 100, starty + 260).add(); }); });

thx stefan

it seems problem

console.log(jsdata);

after removing line working me.

javascript internet-explorer highcharts timeserieschart

No comments:

Post a Comment