gevgeny / angular2-highcharts

:bar_chart: :chart_with_upwards_trend: Highcharts for your Angular project
MIT License
379 stars 113 forks source link

Configuration not followed #140

Open mp3por opened 7 years ago

mp3por commented 7 years ago

Hello,

I would like to create the same graph as the one in this fiddle: http://jsfiddle.net/mp3por/LhLbu5j6/ However using the same configuration object in my angular code does not produce the same result:

Component code:

`options: Object;

constructor(private http: SecureHttpService, private _log: Logger) { this.options = { exporting: { enabled: false }, chart: { backgroundColor: null, type: 'bar', }, title: { text: null }, subtitle: { text: null }, xAxis: { title: { text: null }, labels: { enabled: false } }, yAxis: { gridLineColor: 'transparent', min: 0, title: { text: null }, labels: { enabled: false }, max: 100 }, tooltip: { enabled: false }, plotOptions: { bar: { dataLabels: { enabled: true } } }, legend: { enabled: false, }, credits: { enabled: false }, series: [{ data: [50] }] }; }`

HTML code: http://pastebin.com/Lkd8JERK

Result: https://postimg.org/image/d9htlpucf/

What am I doing wrong?

mp3por commented 7 years ago

https://plnkr.co/edit/aZSNZjz3dTQ2oQlKW39x?p=preview -> plunker

gevgeny commented 7 years ago

everything works ok in the plunker

mp3por commented 7 years ago

Wrong plunker ... one sec

mp3por commented 7 years ago

Sorry man I do not know how to make the stupid plunker save my work. Here is a picture: https://postimg.org/image/k5wsj5sjz/

mp3por commented 7 years ago

Otherwise I have fixed the main issue - sorry about that. Turns out I have to define height and width on the 'chart' element not on the container div :)

mp3por commented 7 years ago

https://plnkr.co/edit/XPlVMJ?p=info -> Finally

gevgeny commented 7 years ago

so it fixed ?

mp3por commented 7 years ago

No the backgroundColor is not being applied ?

gevgeny commented 7 years ago

but still, what is the problem ?

mp3por commented 7 years ago

The problem is that I define that I do not want a background color for my graph yet it puts white.

fpmk commented 7 years ago

backgroundColor: 'rgba(255, 255, 255, 0)'