VChart icon indicating copy to clipboard operation
VChart copied to clipboard

[Bug] Unable to display using line:style:strokelineLabel

Open san346596324 opened this issue 1 year ago • 0 comments

Version

1.12.0

Link to Minimal Reproduction

no

Steps to Reproduce

{
    type: "line",
    data: {
      values: [
        { type: "Nail polish", country: "Africa", value: 4229,num:1 },
        { type: "Eyebrow pencil", country: "Africa", value: 4500 ,num:1},
        { type: "Rouge", country: "Africa", value: 5221 ,num:1},
        { type: "Lipstick", country: "Africa", value: 9256 ,num:1},
        { type: "Eyeshadows", country: "Africa", value: 3308 ,num:1},
        { type: "Eyeliner", country: "Africa", value: 5432 ,num:1},
        { type: "Foundation", country: "Africa", value: 13701 ,num:1},
        { type: "Lip gloss", country: "Africa", value: 4008 ,num:1},
        { type: "Mascara", country: "Africa", value: 18712 ,num:1},

        { type: "Nail polish", country: "EU", value: 4376,num:1},
        { type: "Eyebrow pencil", country: "EU", value: 15000 ,num:1},
        { type: "Rouge", country: "EU", value: 3574 ,num:1},
        { type: "Lipstick", country: "EU", value: 4376 ,num:1},
        { type: "Eyeshadows", country: "EU", value: 4572 ,num:1},
        { type: "Eyeliner", country: "EU", value: 3417 ,num:1},
        { type: "Foundation", country: "EU", value: 5231 ,num:1},
        { type: "Lip gloss", country: "EU", value: 4572 ,num:1},
        { type: "Mascara", country: "EU", value: 6134 ,num:1},

        { type: "Nail polish", country: "China", value: 3054,num:1 },
        { type: "Eyebrow pencil", country: "China", value: 5067 ,num:1},
        { type: "Rouge", country: "China", value: 7004 ,num:1},
        { type: "Lipstick", country: "China", value: 9054 ,num:1},
        { type: "Eyeshadows", country: "China", value: 12043 ,num:1},
        { type: "Eyeliner", country: "China", value: 15067 ,num:1},
        { type: "Foundation", country: "China", value: 10119 ,num:1},
        { type: "Lip gloss", country: "China", value: 12043 ,num:1},
        { type: "Mascara", country: "China", value: 10419 ,num:1},

        { type: "Nail polish", country: "USA", value: 12814 ,num:1},
        { type: "Eyebrow pencil", country: "USA", value: 13012 ,num:1},
        { type: "Rouge", country: "USA", value: 11624 ,num:1},
        { type: "Lipstick", country: "USA", value: 8814 ,num:1},
        { type: "Eyeshadows", country: "USA", value: 12998 ,num:1},
        { type: "Eyeliner", country: "USA", value: 12321 ,num:1},
        { type: "Foundation", country: "USA", value: 10342 ,num:1},
        { type: "Lip gloss", country: "USA", value: 22998 ,num:1},
        { type: "Mascara", country: "USA", value: 11261 ,num:1},
      ],
    },
    color: {
      type: "ordinal",
      domain: [],
      range: colors,
    },
    xField: 'type',
    yField: 'value',
    seriesField: "country",
    legends: [{ type : 'discrete',visible: true, position: "middle", orient: "bottom",layout:"horizontal"}],
    lineLabel: { visible: true },
    line: {
      style: {
        stroke: (value,value1,value2,value3) => {
            if (value && value.value !== undefined) {
              if (value.value > 20000) {
                return 'red';
              }
            }
            return colors[aaa.indexOf(value['country'])];
        }
      }
    }
  }

Current Behavior

Use line:style:stroke to modify the color of the line. As long as the color change is triggered, the lineLabel of the line will not be displayed. 图片

Expected Behavior

Use line:style:strokelineLabel to display

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

san346596324 avatar Aug 21 '24 03:08 san346596324