vue-gantt-schedule-timeline-calendar icon indicating copy to clipboard operation
vue-gantt-schedule-timeline-calendar copied to clipboard

setting config in mounted() breaks chart

Open fancydev18 opened this issue 4 years ago • 7 comments

Hi,

Changing the example at https://github.com/neuronetio/vue-gantt-schedule-timeline-calendar

to set config in mounted() instead of providing initial value in data() breaks the chart -- it's completely empty:

Screenshot from 2020-03-22 08-41-14

Change in code from provided example:

 data() {
        return {
            config: {} //empty initially
        }
    },
    mounted() {
        this.config = {
            height: 300,
            list: {
... 
//exactly the same values as in your example
      }

The watch is triggered correctly, since rows are showing, but the chart part is broken.

fancydev18 avatar Mar 22 '20 06:03 fancydev18

+1, i am facing the same problem

homeir avatar Mar 23 '20 14:03 homeir

+1

b-js avatar Mar 25 '20 14:03 b-js

Probably related: setting chart items resets time from/to

Use case: change time from/to to another period, load different chart items

this.config.chart.items = new_items;

will reset time to the initial values.

fancydev18 avatar Apr 04 '20 06:04 fancydev18

You can load the setting config in the created method image

image image

jiangjun432 avatar Apr 18 '20 02:04 jiangjun432

The bug is deeper. If one wants to change the rows to some other values, the new rows are added to old ones. Even setting list.rows = {} doesn't clear the old values.

Will search for other solutions, this is way too buggy and without support.

fancydev18 avatar May 06 '20 08:05 fancydev18

I would say "setting the config after initial creation" breaks the chart. I am loading my data from a server on created/mounted and after retrieval create the config. It doesn't matter if I create the whole config or just the rows/items, the chart is always empty (except for the rows) ... Who uses static data on initial creation? This totaly beats the purpose of this component.

chaosKP avatar Jun 05 '20 12:06 chaosKP

does anybody found a workaround for this?

rodsouto avatar Jul 14 '20 01:07 rodsouto