New answers tagged

0

Assume your query is in apex controller, then it can run dynamic query return to the JS structure (json might be the best) with all the require input for drawing the graph. Something like: //Construct dynamic SQL list<AggregateResult> aggResult = Database.query('select count(Id) cnt,' + GroupField1 + ',' +GroupField2 + ' from Case group by ' + ...


3

This code works on Salesforce when I try it. ApiVersion: 48 ChartJS: 2.9.3 Template: <template> <div class="chart slds-var-m-around_medium slds-theme_default" lwc:dom="manual"></div> </template> Javascript: import { loadScript, loadStyle } from 'lightning/platformResourceLoader'; import { ShowToastEvent } ...


0

It looks like there's a race condition, so I would fix this by adjusting your chart logic some: _privateData; @api set drawdata(value) { this._privateData = value; if(this.chartjsInitialized) { this.chartjsConfig.data.datasets[0].data = value; this.chart.update(); } } get drawdata() { return this._privateData; } renderedCallback() { ... ...


Top 50 recent answers are included