Replies: 9 comments 3 replies
-
|
as a workaround I also failed with that: ` Its just the same behavior. |
Beta Was this translation helpful? Give feedback.
-
|
There are several places where the failure could be (the scale, the component and (maybe most likely) matrix chart). Could you create a very simple codepen to reproduce? |
Beta Was this translation helpful? Give feedback.
-
|
I dont know how |
Beta Was this translation helpful? Give feedback.
-
|
You can fork that: And I guess you can do the update right after the chart is created. |
Beta Was this translation helpful? Give feedback.
-
|
can you extend it having a button which calls the update chart function giving new data into? |
Beta Was this translation helpful? Give feedback.
-
|
there it is: i guess its having to do with setting the data directly but not using pop on the dataset? may some eventlistener is thrown away? |
Beta Was this translation helpful? Give feedback.
-
|
@kurkle have you noticed my code sample? didnt hear something |
Beta Was this translation helpful? Give feedback.
-
|
popping and pushing elements leads to the same effect: ` componentDidUpdate() { |
Beta Was this translation helpful? Give feedback.
-
|
Sorry for the late reply, but this is the chart.data.datasets[0].data = local_data2;
// these next 2 lines
chart.scales.x.options.labels = [];
chart.scales.y.options.labels = [];
chart.update(); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
in a normal JSChart the scale ticks also update when the underlying data is updated.
E.g. there is on x-axis the ticks
{a,b,c}and data for all of them.After filtering there is no more data for
'b'. While the matrix-tile disappears the 'b'-tick still stays in place.In normal ChartJS 'b' would also disappear now. In Matrix it doesnt.
In Pictures:

How it looks at the beginning:
How it should look after filtering data (in this case no more data for [B,Z]):

How it actually looks:

I tried several play arounds with the labels-array of a
dataset' but it seems that chartjs-matrix is ignoring this array.Instead I was able to achieve tiny changes when working on
scales/x/labels.When using an empty array
[]the chartjs-matrix gathers the labels on its own by the given intial data (in this sample this is{a,b,c}).This does not change after updating the data.
When using a non-empty array
['a','b','c']}this leads to the same behavior.scales: { x: { title: { display: true, text: 'Grade' }, position: 'top', type: 'category', labels: ['d','e','f'], ticks: { display: true }, grid: { display: false } },I tried overwriting any array in the dataset or the chart, but did not have luck yet.

There are severy places knowing of scale-ticks possibly reliable. A short print-out:
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions