Skip to content

Lines with string type categories, VisualMapPiecewise won't work #15115

@Sci-Robot

Description

@Sci-Robot

Version

5.1.1

Steps to reproduce

visualMap: [
{
    type: 'piecewise',
    seriesIndex: 0,
    categories: ["R1-R1", "R1-R2", "R1-R4", "R2-R2", "R2-R4", "R4-R4"],
    // categories: [1, 2, 3, 4, 5, 6],
    inRange: {
        color: ['rgb(102,194,165)','rgb(252,141,98)','rgb(166,216,84)','rgb(141,160,203)','rgb(231,138,195)','rgb(255,217,47)'],
        },
    },
]

My line data:

coords: [
    [line[1], line[0]],
    [line[3], line[2]]
             ],
value: line['LinkType'],

What is expected?

Lines with different types should display different colors.

What is actually happening?

The lines are transparent. However, If I change the line data item 'LinkType' from string to int, like [1, 2, 3, 4 ,5, 6], this code could work. It seems echarts could only recognize the int type, but the string type. I don't know am I right or wrong. Or could this be improved?


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.staleInactive for a long time. Will be closed in 7 days.waiting-for: community

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions