【问题标题】:ExtJS 7.2 chart missing markersExtJS 7.2 图表缺少标记
【发布时间】:2021-08-05 19:29:29
【问题描述】:

无论出于何种原因,我的系列都没有在 ExtJS 7.2 中生成标记。 以下是我的代码,并附上当前输出的图像。

    new Ext.chart.series.Line({
        axis: 'left',
        //smooth: true,
        fill:false,
        xField: 'name',
        yField: 'aggregate',
        style: {
            lineWidth: 2,
            stroke: '#30BDA7',
            fillOpacity: 0.5
        },
        title: 'Aggregate Count',
        tooltip:{
            trackMouse:true,
            titleAlign:'center',
            renderer: function(toolTip, record, ctx) {
                toolTip.setHtml(record.get(ctx.field));
            }
        },
        marker: {
           type: 'path',
           path: ['M', - 4, 0, 0, 4, 4, 0, 0, - 4, 'Z'],
           stroke: '#30BDA7',
           //'stroke-width':5,
           lineWidth: 2,
           fill: 'black'
        },
        showMarkers:true,
        selectionTolerance:20
    })

【问题讨论】:

    标签: extjs


    【解决方案1】:

    经过数小时的搜索,我发现我必须使用延迟渲染向图表添加一个系列。为了修复代码,我只是删除了显式声明“new Ext.chart.series.Line”并将其转换为“type:'line'”。在那之后,一切都神奇地起作用了。原因是该系列在明确定义时不会生成覆盖表面。

    {
        type:'line'
        axis: 'left',
        //smooth: true,
        fill:false,
        xField: 'name',
        yField: 'aggregate',
        style: {
            lineWidth: 2,
            stroke: '#30BDA7',
            fillOpacity: 0.5
        },
        title: 'Aggregate Count',
        tooltip:{
            trackMouse:true,
            titleAlign:'center',
            renderer: function(toolTip, record, ctx) {
                toolTip.setHtml(record.get(ctx.field));
            }
        },
        marker: {
           type: 'path',
           path: ['M', - 4, 0, 0, 4, 4, 0, 0, - 4, 'Z'],
           stroke: '#30BDA7',
           //'stroke-width':5,
           lineWidth: 2,
           fill: 'black'
        },
        showMarkers:true,
        selectionTolerance:20
    }
    

    【讨论】:

      猜你喜欢
      • 2012-08-15
      • 1970-01-01
      • 1970-01-01
      • 2021-09-22
      • 2015-03-03
      • 1970-01-01
      • 2018-07-07
      • 2011-05-23
      • 1970-01-01
      相关资源
      最近更新 更多