chart redrawing problem with yAxis_setter

I’have the following code which got a problem.

$$(“chartStock1”).yAxis_setter({
start:lowestValue,
step:stepValue,
end:highestValue,
template:function(value){
return value
}
});
$$(“chartStock1”).clearAll()
$$(“chartStock1”).parse(jiugangArray);

Firstly, I’d like to reset the yAxis of the line chart and the values are OK. Then I reload the data by parse function and the value array is also OK.

But the line chart was drawn by the older yAxis, not the newest set yAxis value. This is quite confused.

Help, please.

Could somebody help me with this?

Hi,

It’s quite unusual to redefine properties via setters. Please try a more conventional way, via .define():

$$("chartStock1").define("yAxis", { 
    start:lowestValue, 
    step:stepValue, 
    end:highestValue, 
    template:function(value){ return value } 
});
$$("chartStock1").refresh();

If it doesn’t help, please share the snippet of the issue.

Thank you so much, Helga. It really works.

Now I got another question for you, which is also about the line chart. I’ve a ui like described below and I’ve got 100 points to draw in the chart. The point could not be displayed even if I set “scrollview” config for the chart. Why?

Thanks a lot.

var ui = {

    rows: [form1, {
            view: "resizer"
        }, {
            view: "scrollview",
            id: "verses",
            scroll: "x",
            body: {
                view: "chart",
                width: 1000,
                id: "chartStock1",
                type: "line",
                value: "#High#",
                item: {
                    borderColor: "#ffffff",
                    color: "#2b7100"

                },
                tooltip: {
                    template: "#Date#:#High#"
                },
                line: {
                    color: "#8ecf03",
                    width: 2,
                    shadow: true
                },
									offset:false,
                xAxis: {
                    template: ("#Date#"),
                    title: "Date"
                },
                yAxis: {
                    start: 1,
                    step: 0.5,
                    end: 10,
                    template: function(value) {
                        return value
                    },
                    title: "Highest Value"
                }
            }
        }, {
            height: 20
        }
    ]
};

Check the following snippet: http://webix.com/snippet/492e777d

I couldn’t spot any problem here. You can edit the code to show it.

Thank you so much, it really works. The problem is located, which is in “form1” ui. You’re fantastic. Thanks.