admin管理员组

文章数量:1202341

The following is the code that i have used to add patterns in lengends of the billboard graph .

var chart = bb.generate({
  data: {
    columns: [
    ["data1", 30, 200, 100, 400, 150, 250],
    ["data2", 130, 100, 200, 100, 250, 150],
    ["data3", 60, 190, 320, 520, 20, 300],
    ["data4", 80, 20, 250, 320, 180, 50]
    ],
    type: "line", // for ESM specify as: line()
  },
  point: {
    pattern: [
      "circle",
      "rectangle",
      "<polygon points='4 0 0 8 8 8'></polygon>",
      "<polygon points='4 0 0 4 4 8 8 4 4 0'></polygon>"
    ]
  },
  legend: {
    usePoint: true
  },
  bindto: "#usePoint"
});

I tried adding usepoint: true in the tooltip block of the graph and was expececting that the same patterns will be used in the tooltip.

tooltip: {
    format: {
      title: function(d) {
        return 'Data ' + d;
   },
usePoint: true,
      value: function(value, ratio, id) {
        var format = id === "data1" ? d3.format(',') : d3.format('$');

        return format(value);
   }
    }
  }

usepoint is not getting accepted for tooltip and i am getting the following error

Object literal may only specify known properties, and 'usepoint' does not exist in type 'TooltipOptions'.ts(2353)

My expection is to add the same patterns in the tooltip , which i have used in the graph and legend .

image with patterns

本文标签: