bcgov / MFIN-Data-Catalogue

The Finance Data Catalogue enables users to discover data holdings at the BC Ministry of Finance and offers information and functionality that benefits consumers of data for business purposes. The product is built using Drupal and adheres to the Government of BC's Core Administrative and Descriptive etadata Standard.
Other
6 stars 0 forks source link

investigate chart libraries to replace Google #382

Closed NicoledeGreef closed 7 months ago

NicoledeGreef commented 8 months ago

OP timer

https://openplus.monday.com/boards/4092908516/pulses/6269315189


Currently we're using Google Charts as a prototype charting capability. That is not ideal.

CraigClark commented 8 months ago

@lkmorlan: I was talking to Robin, mentioned D3JS as a good candidate

lkmorlan commented 8 months ago

Issue opened during this: https://www.drupal.org/project/charts/issues/3437496

CraigClark commented 8 months ago

@NicoledeGreef some FYI

This is going to take a few deployments to implement. The build we fail if we try to do everything all at once. First we will deploy to enable the module, then we can do another to bring in the config.

lkmorlan commented 8 months ago

Issue opened during this: https://www.drupal.org/project/charts/issues/3436590

lkmorlan commented 8 months ago

charts_billboard is installed. Commit "Switch from charts_google to charts_billboard" in branch 382-replace-google-charts switches to it. After that change, to appear correctly, the charts need config adjusted in BcDcClassificationChart and BcDcRestrictionChart.

After that is deploy, charts_google can be uninstalled using the other commits on that branch.

CraigClark commented 8 months ago

@lkmorlan is there somewhere I can look at this?

lkmorlan commented 8 months ago

In dv14, charts_billboard is installed, available to be used. The charts can be switched and configured.

CraigClark commented 8 months ago

@lkmorlan I was looking into this. We can use views to make charts, which is better than doing it with a module. Unless of course the module is doing something with the chart that views can't.

I have made a view for the Records by restriction and added it to the reports page. This is working except in the view there are settings to set colours for the values in an entity reference, look in the settings for chart in the view. There is a problem however, the colours I selected are not applying. Billboard is using classes in the svg, so we can override with css. It would be better though to set these in the UI as designed.

Could you please look into why we can't get coloured slices in the pie chart for the entity values?

This branch has the view and adds the block to the reports page. https://github.com/bcgov/MFIN-Data-Catalogue/tree/382-records-by-restriction

CraigClark commented 7 months ago

Marking as stuck until the colour issue is resolved.

CraigClark commented 7 months ago

@lkmorlan assigning to you to sort out the colour problem

lkmorlan commented 7 months ago

Getting colors to work in pie charts required this change:

https://www.drupal.org/project/charts/issues/3442641

lkmorlan commented 7 months ago

Colors are working. Records by restriction graph View is merged. Passing to @CraigClark to complete the other graph.

CraigClark commented 7 months ago

@lkmorlan I have adjusted the colours and added a view for the security classification chart on the reports page.

These changes are ready to review/merge https://github.com/bcgov/MFIN-Data-Catalogue/tree/382-adjustments-to-metrics-charts

If we are using views for charts, we might want to get rid of the custom module we had that was doing it. Not sure.

lkmorlan commented 7 months ago

Merged. I removed the unused chart blocks.

CraigClark commented 7 months ago

Closing. New libraries working as expected