2017-06-05 4 views
1

Comment définir un nom de classe pour un graphique exporté dans Highcharts? J'ai essayé, mais cela n'a pas fonctionné:Highcharts export className

exporting: { 
    chartOptions: { 
    chart: { 
     className: 'negPos' 
    } 
    } 
} 
+0

quel est votre objectif d'ajouter la classe class.adding à l'exportation ne fonctionne pas http: //jsfiddle.net/deep3015/1s0h3wng/ –

+0

J'utilise le mode stylé et je voudrais remplacer les couleurs de la colonne dans mon CSS. – ellier7

+0

http://jsfiddle.net/deep3015/1s0h3wng/1/ Cochez cette case –

Répondre

0

negativeColor ajouter à tracer des options

Highcharts.chart(container, { 
 
    chart: { 
 
    //className: 'negPos', 
 
    type: 'column', 
 
    spacingBottom: 20, 
 
    style: { 
 
     fontFamily: 'Helvetica Neue,Helvetica,Arial,sans-serif', 
 
     fontSize: '11px', 
 
     fontWeight: 'lighter' 
 
    } 
 
    }, 
 
    title: { 
 
    text: 'Highcharts', 
 
    align: 'center', 
 
    style: { 
 
     fontSize: '15px', 
 
     fontFamily: 'Helvetica Neue,Helvetica,Arial,sans-serif', 
 
     fontWeight: 'lighter' 
 
    } 
 
    }, 
 
    xAxis: { 
 
    categories: [1, 2, 3, 5, 6] 
 
    }, 
 
    yAxis: { 
 
    title: { 
 
     text: '%' 
 
    } 
 
    }, 
 
    tooltip: { 
 
    borderWidth: 0, 
 
    style: { 
 
     fontFamily: 'Helvetica Neue,Helvetica,Arial,sans-serif', 
 
     fontSize: '11px', 
 
     align: 'center' 
 
    }, 
 
    formatter: function() { 
 
     return '<b>' + this.x + ': </b><br>' + Highcharts.numberFormat(this.y, 1) + '%' 
 
    } 
 
    }, 
 
    plotOptions: { 
 
    column: { 
 
     negativeColor: '#d9534f', 
 
     threshold: 0, 
 
    } 
 
    }, 
 
    /* plotOptions: { 
 
     bar: { 
 
      dataLabels: { 
 
       enabled: false 
 
      } 
 
     } 
 
    },*/ 
 
    legend: { 
 
    layout: 'vertical', 
 
    verticalAlign: 'bottom', 
 
    borderWidth: 1, 
 
    backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'), 
 
    shadow: true 
 
    }, 
 
    series: [{ 
 
    showInLegend: false, 
 
    color: '#5cb85c', 
 
    data: [54, 21, -3, 18, 5, -11] 
 
    }] 
 
});
<script src="https://code.highcharts.com/highcharts.js"></script> 
 
<script src="https://code.highcharts.com/modules/exporting.js"></script> 
 

 
<div id="container"></div>