Closed mFouadShaheen closed 6 years ago
did you get it working?
yes, I just registered it like this in the my module:
`import { ChartModule } from 'angular2-highcharts'; import { HighchartsStatic } from 'angular2-highcharts/dist/HighchartsService';
export function highchartsFactory() { var hc = require('highcharts'); var hcm = require('highcharts/highcharts-more'); var hr = require('highcharts/modules/treemap');
hcm(hc);
hr(hc);
return hc;
}
@NgModule({ providers: [{ provide: HighchartsStatic, useFactory: highchartsFactory }] }) `
and it's now working fine
Thanks, is there any open public repository that I can see the code?
unfortunately no, but I can help you if there's a problem
Thanks for offering me your help, I actually need your help on bringing highcharts in a non-angular-cli project via node-modules with import module. I cannot achieve it. Can you help me with that? link to the project: angular-highcharts-treemap
This issue should be reopened. Because it does not support pure angular2/4 support. We have to add JS files to index.html to get it working, looks like a temporary fix. https://github.com/Janatbek/angular-highcharts-treemap/blob/master/src/index.html
Can anyone get the pure angular2/4 support for Tree map?
Hello,
i tried to use treemap but unfortunately it gives me error#17 each time I included highcharts, highcharts-more and highstock in my app module like this:
export function highchartsFactory() { var hc = require('highcharts'); var hs = require('highcharts/highstock'); var hcm = require('highcharts/highcharts-more'); var ex = require('highcharts/modules/exporting'); var hm = require('highcharts/modules/heatmap'); var sg = require('highcharts/modules/solid-gauge'); hs(hc); hcm(hc); ex(hc); hm(hc); sg(hc); return hc; } providers: [{ provide: HighchartsStatic, useFactory: highchartsFactory }
and then used the example lie this:` this.treeMapOptions = { colorAxis: { minColor: '#FFFFFF', maxColor: '#999' }, series: [{ type: 'treemap', layoutAlgorithm: 'squarified', data: [{ name: 'A', value: 6, colorValue: 'red' }, { name: 'B', value: 6, color: 'yellow' }, { name: 'C', value: 4, color: 'green' }, { name: 'D', value: 3, color: 'blue' }, { name: 'E', value: 2, colorValue: 5 }, { name: 'F', value: 2, colorValue: 6 }, { name: 'G', value: 1, colorValue: 7 }] }], title: { text: 'Highcharts Treemap' } };
<chart [options]="treeMapOptions"> ` but it keeps gives me the #17 error in the console
is there any solution for this!?
thanks