gravity-ui / chartkit

20 stars 5 forks source link

[yagr plugin]: series color does not reset to its original color when clicking on legend #500

Closed dsleepo closed 1 month ago

dsleepo commented 4 months ago

demo

image When clicking on button a twice, the series color for b does not reset to its original color as expected.

Config:

{
  "data": {
    "timeline": [
      1705525200,
      1705611600
    ],
    "timeZone": "UTC",
    "graphs": [
      {
        "id": "a",
        "name": "a",
        "color": "rgb(255,255,0)",
        "data": [
          43.97782069570251,
          42.474166396151084
        ],
        "show": true
      },
      {
        "id": "b",
        "name": "b",
        "color": "rgb(255,0,0)",
        "data": [
          42.814983190371834,
          41.47785724489535
        ],
        "show": true
      }
    ]
  },
  "libraryConfig": {
    "axes": {
      "x": {
        "label": "UTC",
        "labelSize": 25
      },
      "y": {
        "label": "",
        "precision": "auto",
        "scale": "y",
        "side": "left"
      }
    },
    "chart": {
      "appearance": {
      },
      "series": {
        "type": "column",

        "interpolation": "linear"
      },
      "select": {
        "zoom": false
      },
      "timeMultiplier": 0.001
    },
    "cursor": {
      "snapToValues": false,
      "x": {
        "style": "1px solid #ffa0a0"
      },
      "y": {
        "visible": false
      }
    },
    "legend": {
      "show": true
    },
    "scales": {
      "x": {},
      "y": {
        "normalize": false,
        "stacking": true,
        "type": "linear"
      },
      "yRight": {
        "normalize": false,
        "stacking": true,
        "type": "linear"
      }
    },
    "tooltip": {
      "show": true,
      "hideNoData": false,
      "maxLines": 15,
      "percent": false,
      "precision": 2,
      "sum": false,
      "tracking": "area",
      "className": "chartkit-yagr-tooltip"
    }
  }
}