Closed s-egge closed 1 month ago
Before updating Vue-Chartjs from v3 to v4, there was a console error when attempting to display the graph: "Uncaught TypeError: createElement is not a function." This error occurs because Vue-Chartjs v3 does not support Vue3. Vue-Chartjs v4/v5 both support Vue3 so we'll have to upgrade. This article could be useful: Vue-Chartjs Migration Guide
The chart is now visible, but has some pretty big formatting issues still. The chart on the small map view has a bug where the width keeps expanding and the canvas exceeds max size, but that seems like it's a map.vue issue and not a chart issue.
{chartType}.js
files need to me migrated to Vue components, based on the migration guide aboveluxon
and chartjs-adapter-luxon
), which translates the milliseconds into the formatting we request. Here is the Luxon repo for referenceWe'll need to go through all of the chart options and update them to the new syntax as needed and fix the formatting options on the chart above. The Edit Block Modal is broken right now, so we can't test different time frames or multiple time periods until that's fixed
ChartJS Linechart styling fixed (dev v. prod):
Before vs After
Issue The style-variables.scss file in the Energy Dashboard serves a dual purpose: it defines styling variables for global use while also overriding Element UI/Plus variables. The variables with leading hyphens (--) are specifically used to override Element UI/Plus default styles. Removing these hyphens caused the styles to revert to the default Element UI/Plus theme (blue), as shown in the screenshot.
Changes I broke up the variables into three groupings:
Some buildings seem to lack a name resulting in a blank tooltip when hovering on the map.
Key Things to Note:
Most documentations recommend not using $parent because it makes code less readable and harder to debug. Going forward we should consider removing references to $parent, and instead, use props. This is important to consider when transitioning the barchart.js into a vue component as it has similar characteristics to the linechart component.
TODO
this.map
, see notes below)