【问题标题】:EXTJS chart with fixed numeric axis具有固定数值轴的 EXTJS 图表
【发布时间】:2014-02-22 08:36:44
【问题描述】:

有人可以帮助我吗?我可以使用 extjs 制作图表,但现在我不知道该怎么做。所以,我建立了一个散点图并想使用固定的数字 x 和 y 轴,从 0 到 5,我现在的图表只是根据我商店的值自动决定我的数字轴的范围值,我不想要那个。

Ext.create('Ext.chart.Chart', {
renderTo: myChart,
width: 500,
height: 300,
animate: true,
theme:'Category1',
store: store,
axes: [{
    type: 'Numeric',
    position: 'left',
    title: 'Kepentingan',
    grid: true,
    minimum: 0
}, {
    type: 'Numeric',
    position: 'bottom',
    title: 'Kinerja',
    grid: true,
    minimum: 0
}],
series: [ {
    type: 'scatter',
    markerConfig: {
        radius: 5,
        size: 5
    },
    axis: 'left',
    xField: 'data2',
    yField: 'data3'
}]
});

我应该在图表的轴部分更改什么?请帮忙。非常感谢您的帮助。

【问题讨论】:

    标签: javascript extjs charts


    【解决方案1】:

    尝试在坐标区数组中添加一个设置为 5 的最大属性(对于 Ox 和 Oy)。添加演示链接只是为了查看 Oy 轴的 maximum 属性的结果。

    Click me.

    axes: [{
             type: 'Numeric',
             position: 'left',
             title: 'Kepentingan',
             grid: true,
             minimum: 0,
             maximum: 5
        },
        {
            type: 'Numeric',
            position: 'bottom',
            title: 'Kinerja',
            grid: true,
            minimum: 0,
            maximum: 5
        }]
    

    【讨论】:

    • 不起作用,轴仍然显示来自商店的最大值 :(。但感谢您的帮助 :)
    猜你喜欢
    • 1970-01-01
    • 2012-03-11
    • 2019-02-13
    • 1970-01-01
    • 2019-02-27
    • 2014-04-03
    • 1970-01-01
    • 2021-10-26
    • 2021-02-23
    相关资源
    最近更新 更多