angular2-highcharts icon indicating copy to clipboard operation
angular2-highcharts copied to clipboard

Configuration not followed

Open mp3por opened this issue 7 years ago • 11 comments

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 avatar Jan 06 '17 12:01 mp3por

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

mp3por avatar Jan 06 '17 12:01 mp3por

everything works ok in the plunker

gevgeny avatar Jan 06 '17 12:01 gevgeny

Wrong plunker ... one sec

mp3por avatar Jan 06 '17 12:01 mp3por

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 avatar Jan 06 '17 12:01 mp3por

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 avatar Jan 06 '17 12:01 mp3por

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

mp3por avatar Jan 06 '17 13:01 mp3por

so it fixed ?

gevgeny avatar Jan 06 '17 13:01 gevgeny

No the backgroundColor is not being applied ?

mp3por avatar Jan 06 '17 13:01 mp3por

but still, what is the problem ?

gevgeny avatar Jan 06 '17 13:01 gevgeny

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

mp3por avatar Jan 06 '17 13:01 mp3por

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

fpmk avatar Feb 10 '17 15:02 fpmk