Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" src="<?php echo base_url('asset/js/charts/v_soaotc_daily.js')?>"></script>
- $(function () {
- $('#soaotc_daily_chart').highcharts({
- chart: {
- zoomType: 'xy'
- },
- title: {
- text: 'SOA_OTC Daily'
- },
- xAxis: [{
- categories: []
- }],
- yAxis: [{ // Primary yAxis
- labels: {
- // format: '{value} Rs.',
- style: {
- color: Highcharts.getOptions().colors[1]
- }
- },
- title: {
- text: 'Amount',
- style: {
- color: Highcharts.getOptions().colors[1]
- }
- }
- }, { // Secondary yAxis
- title: {
- text: 'Population',
- style: {
- color: Highcharts.getOptions().colors[0]
- }
- },
- labels: {
- //format: '{value} out of 100',
- style: {
- color: Highcharts.getOptions().colors[0]
- }
- },
- opposite: true
- }],
- tooltip: {
- shared: true
- },
- legend: {
- layout: 'vertical',
- align: 'left',
- x: 120,
- verticalAlign: 'top',
- y: 100,
- floating: true,
- backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
- },
- series: [{
- name: 'Population',
- type: 'column',
- yAxis: 1,
- data: [],
- tooltip: {
- // valueSuffix: ' out of 100'
- },
- dataLabels: {
- enabled: true,
- // format: '{point.y:.0f}/100'
- }
- }, {
- name: 'Amount',
- type: 'spline',
- data: [],
- tooltip: {
- valueSuffix: ''
- }
- }]
- }, function(theChart){
- $.getJSON("<?php echo base_url(); ?>soaotc/daily_json", function(json) {
- alert('sukses');
- theChart.xAxis[0].setCategories(json[0]['data']);
- theChart.series[0].setData(json[1]['data'], false);
- theChart.series[1].setData(json[2]['data'], true);
- })
- .fail( function(d, textStatus, error) {
- console.error("getJSON failed, status: " + textStatus + ", error: "+error)
- });
- });
- var theChart = $('#container').highcharts();
- });
- getJSON failed, status: parsererror, error: SyntaxError: Unexpected token D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement