Stephanevg / PSHTML

Cross platform Powershell module to generate HTML markup language
https://pshtml.readthedocs.io/en/latest/
Other
168 stars 43 forks source link

Some charts not working with chart.js 3 upward #303

Open tsiamer opened 11 months ago

tsiamer commented 11 months ago

Subject of the issue

Describe your issue here. Using chart.js 2.9.4 and everything works fine, but when i update to chart.js 3 or 4 it just does not show the bar charts

Steps to reproduce

Tell us how to reproduce this issue. Errors:

function mergeScaleConfig(config, options) {
  const chartDefaults = overrides[config.type] || {scales: {}};
  const configScales = options.scales || {};
  const chartIndexAxis = getIndexAxis(config.type, options);
  const firstIDs = Object.create(null);
  const scales = Object.create(null);
  Object.keys(configScales).forEach(id => {
    const scaleConf = configScales[id];
    if (!isObject(scaleConf)) {
      return console.error(`Invalid scale configuration for scale: ${id}`);
    }
    if (scaleConf._proxy) {

  if (!isObject(scaleConf)) {
      return console.error(`Invalid scale configuration for scale: ${id}`);
    }
    if (scaleConf._proxy) {
      return console.warn(`Ignoring resolver passed as options for scale: ${id}`);
    }
    const axis 

Expected behaviour

It should have worked as with the previous chart.js version

Actual behaviour

It should have rendered the bar chart, also will their be any options to configure the grid on and off, seems now chart.js are off by default.

Stephanevg commented 4 months ago

Hi, Can you provide the code you have used to produce the error ? Also, can you provide maybe the error (If any) that is available in the console view of the webdev tools of your browser ? (The code you have provided as an error example is just a javascript function, I don't see how this helps. Are you sure you provided the right snippet? :) )

In the mean time, I have prepared an issue (#306) to upgrade pshtml to ship with a later version of chart.js.