<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: SimaQ</title>
    <description>The latest articles on DEV Community by SimaQ (@simaq).</description>
    <link>https://dev.to/simaq</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F95558%2Fc535cbf9-81f7-46f3-a9d6-781e181f68ea.jpeg</url>
      <title>DEV Community: SimaQ</title>
      <link>https://dev.to/simaq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/simaq"/>
    <language>en</language>
    <item>
      <title>How to draw a combination diagram with React</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:31:05 +0000</pubDate>
      <link>https://dev.to/simaq/how-to-draw-a-combination-diagram-with-react-362b</link>
      <guid>https://dev.to/simaq/how-to-draw-a-combination-diagram-with-react-362b</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;How to draw combo diagrams in React&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;May I ask how to render the composite image?&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Take a look at this online codesandbox example~ &lt;a href="https://codesandbox.io/p/sandbox/visactor-vchart-react-demo-forked-h4dyjl?file=%2Fsrc%2FCommonChart.tsx%3A43%2C29"&gt;https://codesandbox.io/p/sandbox/visactor-vchart-react-demo-forked-h4dyjl?file=%2Fsrc%2FCommonChart.tsx%3A43%2C29&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5hlc96gmlkhaip3r5khh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5hlc96gmlkhaip3r5khh.png" alt="Image description" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Demo：&lt;a href="https://codesandbox.io/p/sandbox/visactor-vchart-react-demo-forked-h4dyjl?file=%2Fsrc%2FCommonChart.tsx%3A43%2C29"&gt;https://codesandbox.io/p/sandbox/visactor-vchart-react-demo-forked-h4dyjl?file=%2Fsrc%2FCommonChart.tsx%3A43%2C29&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Tutorial: &lt;a href="https://visactor.io/vchart/guide/tutorial_docs/Chart_Types/Combination"&gt;https://visactor.io/vchart/guide/tutorial_docs/Chart_Types/Combination&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.io/vchart/option/commonChart"&gt;https://visactor.io/vchart/option/commonChart&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>The combination chart and line chart are blocked, causing the tooltip to not be hover.</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:29:28 +0000</pubDate>
      <link>https://dev.to/simaq/the-combination-chart-and-line-chart-are-blocked-causing-the-tooltip-to-not-be-hover-4pdk</link>
      <guid>https://dev.to/simaq/the-combination-chart-and-line-chart-are-blocked-causing-the-tooltip-to-not-be-hover-4pdk</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;The combination chart and line chart are blocked, causing the tooltip to not be hover.&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;The combination chart and line chart are blocked by the column, causing hover to fail to produce tooltip.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpczphlj9ljp5xvjqt7hr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpczphlj9ljp5xvjqt7hr.png" alt="Image description" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;You can adjust the order of series declaration, declare bar series first and then declare line series, so that the polyline will be displayed above the column.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Tutorial: &lt;a href="https://visactor.io/vchart/guide/tutorial_docs/Chart_Types/Combination"&gt;https://visactor.io/vchart/guide/tutorial_docs/Chart_Types/Combination&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.io/vchart/option/commonChart"&gt;https://visactor.io/vchart/option/commonChart&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>visactor</category>
      <category>vchart</category>
    </item>
    <item>
      <title>How to assign different colors to multiple lines in a line chart</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:27:49 +0000</pubDate>
      <link>https://dev.to/simaq/how-to-assign-different-colors-to-multiple-lines-in-a-line-chart-1la9</link>
      <guid>https://dev.to/simaq/how-to-assign-different-colors-to-multiple-lines-in-a-line-chart-1la9</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;How to assign different colors to multiple lines in a line chart&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;Hello, how to assign different colors to multiple polylines?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1q92lmbsqo5rh711lck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1q92lmbsqo5rh711lck.png" alt="Image description" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; Configure color in spec, you can refer to this demo &lt;a href="https://visactor.bytedance.net/vchart/demo/area-chart/stream-graph"&gt;https://visactor.bytedance.net/vchart/demo/area-chart/stream-graph&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; Configure the color in the element style, you can refer to &lt;a href="https://visactor.bytedance.net/vchart/demo/line-chart/multi-line"&gt;https://visactor.bytedance.net/vchart/demo/line-chart/multi-line&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; Set the color palette by theme, you can refer to the demo &lt;a href="https://visactor.bytedance.net/vchart/demo/theme/theme-switch"&gt;https://visactor.bytedance.net/vchart/demo/theme/theme-switch &lt;/a&gt;, documentation: &lt;a href="https://visactor.bytedance.net/vchart/guide/tutorial_docs/Theme/Color_Theme"&gt;https://visactor.bytedance.net/vchart/guide/tutorial_docs/Theme/Color_Theme&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Demo：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;a href="https://visactor.bytedance.net/vchart/demo/area-chart/stream-graph"&gt;https://visactor.bytedance.net/vchart/demo/area-chart/stream-graph&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://visactor.bytedance.net/vchart/demo/line-chart/multi-line"&gt;https://visactor.bytedance.net/vchart/demo/line-chart/multi-line&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;a href="https://visactor.bytedance.net/vchart/demo/theme/theme-switch"&gt;https://visactor.bytedance.net/vchart/demo/theme/theme-switch&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tutorial: &lt;a href="https://visactor.bytedance.net/vchart/guide/tutorial_docs/Theme/Color_Theme"&gt;&lt;/a&gt;&lt;a href="https://visactor.bytedance.net/vchart/guide/tutorial_docs/Theme/Color_Theme"&gt;https://visactor.bytedance.net/vchart/guide/tutorial_docs/Theme/Color_Theme&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;&lt;/a&gt;&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vchart</category>
      <category>visactor</category>
    </item>
    <item>
      <title>Can the tip displayed above be configured to modify the background color and text color when hovering a long label?</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:25:50 +0000</pubDate>
      <link>https://dev.to/simaq/can-the-tip-displayed-above-be-configured-to-modify-the-background-color-and-text-color-when-hovering-a-long-label-4g19</link>
      <guid>https://dev.to/simaq/can-the-tip-displayed-above-be-configured-to-modify-the-background-color-and-text-color-when-hovering-a-long-label-4g19</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;Can the tip displayed above be configured to modify the background color and text color when hovering a long label?&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;Can the tip displayed above be configured to modify the background color and text color when hovering a long label?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzxr1k3ea0gl6xtv5fz7d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzxr1k3ea0gl6xtv5fz7d.png" alt="Image description" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Just configure the poptip property in the theme.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;theme:{
    component: {
      poptip: {
        contentStyle: {
          fill: '#fff',
        },
        panel: {
          fill: '#ccc'
        }
      }
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const spec = {
  type: 'bar',
  data: [
    {
      id: 'barData',
      values: [
        {
          name: 'AppleAppleAppleAppleAppleAppleAppleAppleAppleAppleApple',
          value: 214480
        },
        {
          name: 'Google',
          value: 155506
        },
        {
          name: 'Amazon',
          value: 100764
        },
        {
          name: 'Microsoft',
          value: 92715
        },
        {
          name: 'Coca-Cola',
          value: 66341
        },
        {
          name: 'Samsung',
          value: 59890
        },
        {
          name: 'Toyota',
          value: 53404
        },
        {
          name: 'Mercedes-Benz',
          value: 48601
        },
        {
          name: 'Facebook',
          value: 45168
        },
        {
          name: "McDonald's",
          value: 43417
        },
        {
          name: 'Intel',
          value: 43293
        },
        {
          name: 'IBM',
          value: 42972
        },
        {
          name: 'BMW',
          value: 41006
        },
        {
          name: 'Disney',
          value: 39874
        },
        {
          name: 'Cisco',
          value: 34575
        },
        {
          name: 'GE',
          value: 32757
        },
        {
          name: 'Nike',
          value: 30120
        },
        {
          name: 'Louis Vuitton',
          value: 28152
        },
        {
          name: 'Oracle',
          value: 26133
        },
        {
          name: 'Honda',
          value: 23682
        }
      ]
    }
  ],
  direction: 'horizontal',
  xField: 'value',
  yField: 'name',
  axes: [
    {
      orient: 'bottom',
      visible: false
    }
  ],
  label: {
    visible: true
  },
  theme:{
    component: {
      poptip: {
        contentStyle: {
          fill: '#fff',
        },
        panel: {
          fill: '#ccc'
        }
      }
    }
  }
};

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F69ug3t28271wzjn6ri3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F69ug3t28271wzjn6ri3w.png" alt="Image description" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.io/vchart/option/barChart#theme.component"&gt;https://visactor.io/vchart/option/barChart#theme.component&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vchart</category>
      <category>visactor</category>
    </item>
    <item>
      <title>How to remove the axis scale value?</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:23:50 +0000</pubDate>
      <link>https://dev.to/simaq/how-to-remove-the-axis-scale-value-43ob</link>
      <guid>https://dev.to/simaq/how-to-remove-the-axis-scale-value-43ob</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;How to remove axis scale values?&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;How to remove the content in the red box?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpntbya37em0vcgkwvg1c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpntbya37em0vcgkwvg1c.png" alt="Image description" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;You can configure the label.visible of the bottom axis to false to turn off the axis label.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn3uwrlhq97ttiwlhpypw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn3uwrlhq97ttiwlhpypw.png" alt="Image description" width="800" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Tutorial: &lt;a href="https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Axes"&gt;https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Axes&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.bytedance.net/vchart/option/barChart#axes-linear"&gt;https://visactor.bytedance.net/vchart/option/barChart#axes-linear&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>visactor</category>
      <category>vchart</category>
    </item>
    <item>
      <title>How to configure tooltip and legend shape as rectangles with rounded corners</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:22:03 +0000</pubDate>
      <link>https://dev.to/simaq/how-to-configure-tooltip-and-legend-shape-as-rectangles-with-rounded-corners-36mg</link>
      <guid>https://dev.to/simaq/how-to-configure-tooltip-and-legend-shape-as-rectangles-with-rounded-corners-36mg</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;How to configure Legend Shape as a rectangle with rounded corners?&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;As shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqu2b0lm4hstlt1yxhxpy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqu2b0lm4hstlt1yxhxpy.png" alt="Image description" width="800" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Support configuration as'rectRound 'type&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Tooltip: &lt;code&gt;shapeType:"rectRound"&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tooltip: {
    mark: {
      content: [
        {
          shapeType: 'rectRound',
          key: datum =&amp;gt; datum['type'],
          value: datum =&amp;gt; datum['value'] + '%'
        }
      ]
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt; Legend:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;legends: {
    visible: true,
    orient: 'right',

    item: {
      width: '15%',
      shape: {
        style: {
          symbolType: 'rectRound'
        }
      }
    }
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const spec = {
  type: 'pie',
  data: [
    {
      id: 'pie',
      values: [
  { value: 10, category: 'One' },
  { value: 9, category: 'Two' },
  { value: 6, category: 'Three' },
  { value: 5, category: 'Four' },
  { value: 4, category: 'Five' },
  { value: 3, category: 'Six' },
  { value: 1, category: 'Seven' }
]
    }
  ],
  categoryField: 'category',
  valueField: 'value',
  legends: {
    visible: true,
    orient: 'right',

    item: {
      width: '15%',
      shape: {
        style: {
          symbolType: 'rectRound'
        }
      }
    }
  },
  tooltip: {
    mark: {
      content: [
        {
          shapeType: 'rectRound',
          key: datum =&amp;gt; datum['type'],
          value: datum =&amp;gt; datum['value'] + '%'
        }
      ]
    }
  }
};

const vchart = new VChart(spec, { dom: CONTAINER_ID });

vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftdbm6vmz995be1ov86nr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftdbm6vmz995be1ov86nr.png" alt="Image description" width="800" height="544"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Tutorials: &lt;a href="https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Legend"&gt;https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Legend&lt;/a&gt; , &lt;a href="https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Tooltip"&gt;https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Tooltip&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.bytedance.net/vchart/option/barChart#tooltip.dimension.content%EF%BC%8Chttps://visactor.bytedance.net/vchart/option/barChart-legends-discrete#item.shape.style.symbolType"&gt;https://visactor.bytedance.net/vchart/option/barChart#tooltip.dimension.content，https://visactor.bytedance.net/vchart/option/barChart-legends-discrete#item.shape.style.symbolType&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>visactor</category>
      <category>vchart</category>
    </item>
    <item>
      <title>Right-aligned bar chart numeric labels</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:20:03 +0000</pubDate>
      <link>https://dev.to/simaq/right-aligned-bar-chart-numeric-labels-3c06</link>
      <guid>https://dev.to/simaq/right-aligned-bar-chart-numeric-labels-3c06</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;Right-aligned display of bar chart numerical labels&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;Display the labels uniformly on the right and align them to the right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkywlx23f1z6rkf20ec2e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkywlx23f1z6rkf20ec2e.png" alt="Image description" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;You can use the &lt;code&gt;extensionMark&lt;/code&gt;property provided by VChart to implement it through custom graphics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const spec = {
  type: 'bar',
  data: [
    {
      id: 'barData',
      values: [
        {
          name: 'Apple',
          value: 214480
        },
        {
          name: 'Google',
          value: 155506
        },
        {
          name: 'Amazon',
          value: 100764
        },
        {
          name: 'Microsoft',
          value: 92715
        },
        {
          name: 'Coca-Cola',
          value: 66341
        },
        {
          name: 'Samsung',
          value: 59890
        },
        {
          name: 'Toyota',
          value: 53404
        },
        {
          name: 'Mercedes-Benz',
          value: 48601
        },
        {
          name: 'Facebook',
          value: 45168
        },
        {
          name: "McDonald's",
          value: 43417
        },
        {
          name: 'Intel',
          value: 43293
        },
        {
          name: 'IBM',
          value: 42972
        },
        {
          name: 'BMW',
          value: 41006
        },
        {
          name: 'Disney',
          value: 39874
        },
        {
          name: 'Cisco',
          value: 34575
        },
        {
          name: 'GE',
          value: 32757
        },
        {
          name: 'Nike',
          value: 30120
        },
        {
          name: 'Louis Vuitton',
          value: 28152
        },
        {
          name: 'Oracle',
          value: 26133
        },
        {
          name: 'Honda',
          value: 23682
        }
      ]
    }
  ],
  direction: 'horizontal',
  xField: 'value',
  yField: 'name',
  axes: [
    {
      orient: 'bottom',
      visible: false
    }
  ],
  label: {
    visible: false
  },
  extensionMark: [
    {
      type: 'text',
      dataId: 'barData',
      visible: true,
      style: {
        text: datum =&amp;gt; datum.value,
        fontSize: 12,
        x: (datum, ctx) =&amp;gt; {
          return ctx.getRegion().getLayoutRect().width + 10;
        },
        y: (datum, ctx) =&amp;gt; {
          return ctx.valueToY([datum.name]) + ctx.yBandwidth() / 2;
        },
        textBaseline: 'middle',
        textAlign: 'right',
        fill: "#1664FF",
        fontSize: 12
      }
    }
  ]
};

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0uk6bcu7gyq7eymajdpm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0uk6bcu7gyq7eymajdpm.png" alt="Image description" width="800" height="759"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Tutorial: &lt;a href="https://visactor.io/vchart/guide/tutorial_docs/extend/custom_mark"&gt;https://visactor.io/vchart/guide/tutorial_docs/extend/custom_mark&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.io/vchart/option/barChart#extensionMark"&gt;https://visactor.io/vchart/option/barChart#extensionMark&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>visactor</category>
      <category>vchart</category>
    </item>
    <item>
      <title>The content displayed in the line chart is currently all selected by default. Is it possible to have a channel inversion</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:17:12 +0000</pubDate>
      <link>https://dev.to/simaq/the-content-displayed-in-the-line-chart-is-currently-all-selected-by-default-is-it-possible-to-have-a-channel-inversion-1p63</link>
      <guid>https://dev.to/simaq/the-content-displayed-in-the-line-chart-is-currently-all-selected-by-default-is-it-possible-to-have-a-channel-inversion-1p63</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;The content displayed in the line chart is currently all selected and displayed by default. Is it possible to have a channel inversion (for example, there is a button that is not displayed with one click)?&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;Chart legend can be selected all or not all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;You can configure the &lt;code&gt;legends.defaultSelected&lt;/code&gt;parameter to an empty array: &lt;code&gt;[]&lt;/code&gt;, restore to all selected words, delete this parameter or copy the full amount of legend items.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const spec = {
  type: 'area',
  data: {
    values: [
      { type: 'Nail polish', country: 'Africa', value: 4229 },
      { type: 'Nail polish', country: 'EU', value: 4376 },
      { type: 'Nail polish', country: 'China', value: 3054 },
      { type: 'Nail polish', country: 'USA', value: 12814 },
      { type: 'Eyebrow pencil', country: 'Africa', value: 3932 },
      { type: 'Eyebrow pencil', country: 'EU', value: 3987 },
      { type: 'Eyebrow pencil', country: 'China', value: 5067 },
      { type: 'Eyebrow pencil', country: 'USA', value: 13012 },
      { type: 'Rouge', country: 'Africa', value: 5221 },
      { type: 'Rouge', country: 'EU', value: 3574 },
      { type: 'Rouge', country: 'China', value: 7004 },
      { type: 'Rouge', country: 'USA', value: 11624 },
      { type: 'Lipstick', country: 'Africa', value: 9256 },
      { type: 'Lipstick', country: 'EU', value: 4376 },
      { type: 'Lipstick', country: 'China', value: 9054 },
      { type: 'Lipstick', country: 'USA', value: 8814 },
      { type: 'Eyeshadows', country: 'Africa', value: 3308 },
      { type: 'Eyeshadows', country: 'EU', value: 4572 },
      { type: 'Eyeshadows', country: 'China', value: 12043 },
      { type: 'Eyeshadows', country: 'USA', value: 12998 },
      { type: 'Eyeliner', country: 'Africa', value: 5432 },
      { type: 'Eyeliner', country: 'EU', value: 3417 },
      { type: 'Eyeliner', country: 'China', value: 15067 },
      { type: 'Eyeliner', country: 'USA', value: 12321 },
      { type: 'Foundation', country: 'Africa', value: 13701 },
      { type: 'Foundation', country: 'EU', value: 5231 },
      { type: 'Foundation', country: 'China', value: 10119 },
      { type: 'Foundation', country: 'USA', value: 10342 },
      { type: 'Lip gloss', country: 'Africa', value: 4008 },
      { type: 'Lip gloss', country: 'EU', value: 4572 },
      { type: 'Lip gloss', country: 'China', value: 12043 },
      { type: 'Lip gloss', country: 'USA', value: 22998 },
      { type: 'Mascara', country: 'Africa', value: 18712 },
      { type: 'Mascara', country: 'EU', value: 6134 },
      { type: 'Mascara', country: 'China', value: 10419 },
      { type: 'Mascara', country: 'USA', value: 11261 }
    ]
  },
  title: {
    visible: true,
    text: '100% stacked area chart of cosmetic products sales'
  },
  percent: true,
  xField: 'type',
  yField: 'value',
  seriesField: 'country',
  legends: [
    { 
      visible: true, 
      position: 'middle', 
      orient: 'bottom',
      defaultSelected: []
    }
    ],
  axes: [
    {
      orient: 'left',
      label: {
        formatMethod(val) {
          return `${(val * 100).toFixed(2)}%`;
        }
      }
    }
  ]
};

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1pm06v8hlzm5sk9b4zg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1pm06v8hlzm5sk9b4zg.png" alt="Image description" width="800" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Tutorial: &lt;a href="https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Legend"&gt;https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Legend&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.io/vchart/option/barChart#legends"&gt;https://visactor.io/vchart/option/barChart#legends&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>visactor</category>
      <category>vchart</category>
    </item>
    <item>
      <title>How to modify the tag graphic of the tooltip content item</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:15:36 +0000</pubDate>
      <link>https://dev.to/simaq/how-to-modify-the-tag-graphic-of-the-tooltip-content-item-38pg</link>
      <guid>https://dev.to/simaq/how-to-modify-the-tag-graphic-of-the-tooltip-content-item-38pg</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;How to modify the tag graphic of the tooltip content item?&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;I want to change the shape in the tooltip to linear for line charts. Is there a good implementation?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvls3o2hp419q7zhdidx9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvls3o2hp419q7zhdidx9.png" alt="Image description" width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Modify &lt;code&gt;shapeType&lt;/code&gt;to &lt;code&gt;'rect '&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const spec = {
    type: 'bar',
    data: [
      {
        id: 'barData',
        values: [
          { month: 'Monday', sales: 22 },
          { month: 'Tuesday', sales: 13 },
          { month: 'Wednesday', sales: 25 },
          { month: 'Thursday', sales: 29 },
          { month: 'Friday', sales: 38 }
        ]
      }
    ],
    tooltip: {
      mark: { 
        content: 
        [{ key: datum =&amp;gt; datum['month'], value: datum =&amp;gt; datum['sales'], shapeType: 'rect' }] 
      }
    },
    xField: 'month',
    yField: 'sales'
  };
  const vchart = new VChart(spec, { dom: CONTAINER_ID });
  vchart.renderSync();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Results show
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zrepgfmkldr5j8mm5oc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zrepgfmkldr5j8mm5oc.png" alt="Image description" width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Tutorial: &lt;a href="https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Tooltip"&gt;https://visactor.io/vchart/guide/tutorial_docs/Chart_Concepts/Tooltip&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.io/vchart/option/barChart#tooltip.dimension.content(Object%7CObject%5B%5D).shapeType"&gt;https://visactor.io/vchart/option/barChart#tooltip.dimension.content(Object%7CObject%5B%5D).shapeType&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>visactor</category>
      <category>vchart</category>
    </item>
    <item>
      <title>How the word cloud fills the outer container display</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Wed, 26 Jun 2024 07:13:03 +0000</pubDate>
      <link>https://dev.to/simaq/how-the-word-cloud-fills-the-outer-container-display-2f6n</link>
      <guid>https://dev.to/simaq/how-the-word-cloud-fills-the-outer-container-display-2f6n</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;How to display a word cloud on top of the outer container?&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;We have a relatively small scene displaying word clouds, hoping to make the word cloud fill the entire container as much as possible. I tried the official website, but it seems that it cannot fill the container&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqyjbw5xvbkqbyrz9xikg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqyjbw5xvbkqbyrz9xikg.png" alt="Image description" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4s631tqdovqg4t849ij6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4s631tqdovqg4t849ij6.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;This is because in VChart, the word cloud is defaulted to use &lt;code&gt;'circle '&lt;/code&gt;circular markShape mask graphics, if you want to fill the container as much as possible, you can use &lt;code&gt;'rect'&lt;/code&gt;shape.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const spec = {
  type: 'wordCloud',
  nameField: 'Keyword',
  valueField: 'Score',
  data: {
    name: 'baseData',
    values: [ { "Keyword": "预期寿命", "Score": 0.8571 }, { "Keyword": "心率", "Score": 0.8571 }, { "Keyword": "疾病", "Score": 0.7597 }, { "Keyword": "心跳快慢", "Score": 0.5714 }, { "Keyword": "心跳", "Score": 0.5714 }, { "Keyword": "郭艺芳", "Score": 0.5624 }, { "Keyword": "陈清勇", "Score": 0.5624 }, { "Keyword": "风险因素", "Score": 0.4874 }, { "Keyword": "心动过速", "Score": 0.4874 }, { "Keyword": "寿命", "Score": 0.3849 }, { "Keyword": "快慢", "Score": 0.3844 }, { "Keyword": "生活习惯", "Score": 0.2857 }, { "Keyword": "河北省人民医院", "Score": 0.2857 }, { "Keyword": "四川大学华西医院", "Score": 0.2186 }, { "Keyword": "华西医院", "Score": 0.2121 }, { "Keyword": "阿尔茨海默病", "Score": 0.2067 }, { "Keyword": "人群", "Score": 0.1984 }, { "Keyword": "痴呆", "Score": 0.19 }, { "Keyword": "研究", "Score": 0.1761 }, { "Keyword": "健康", "Score": 0.1754 }, { "Keyword": "习惯", "Score": 0.1709 }, { "Keyword": "医院", "Score": 0.1664 }, { "Keyword": "风险", "Score": 0.1647 }, { "Keyword": "心内科", "Score": 0.16 }, { "Keyword": "生活", "Score": 0.158 }, { "Keyword": "工作", "Score": 0.1554 }, { "Keyword": "心血管疾病", "Score": 0.1299 }, { "Keyword": "咖啡", "Score": 0.0974 }, { "Keyword": "志飞", "Score": 0.0974 }, { "Keyword": "中国妇女报", "Score": 0.0974 }, { "Keyword": "人民医院", "Score": 0.0913 } ]
  },
  maskShape: 'rect',
  width: 400,
  height: 300,
  background: '#cccc',
  padding: 10
};
const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Results show
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrui1ob26geng0fn3zde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmrui1ob26geng0fn3zde.png" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Tutorial: &lt;a href="https://visactor.io/vchart/guide/tutorial_docs/Chart_Types/WordCloud"&gt;https://visactor.io/vchart/guide/tutorial_docs/Chart_Types/WordCloud&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.io/vchart/option/wordCloudChart#type"&gt;https://visactor.io/vchart/option/wordCloudChart#type&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vchart</category>
      <category>visactor</category>
    </item>
    <item>
      <title>How to disable the display of abbreviated tooltips. Customized tooltips do not need to be displayed again</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Fri, 10 May 2024 06:26:04 +0000</pubDate>
      <link>https://dev.to/simaq/how-to-disable-the-display-of-abbreviated-tooltips-customized-tooltips-do-not-need-to-be-displayed-again-1d3</link>
      <guid>https://dev.to/simaq/how-to-disable-the-display-of-abbreviated-tooltips-customized-tooltips-do-not-need-to-be-displayed-again-1d3</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;How to disable the display of abbreviated tooltips. Customized tooltips do not need to be displayed again?&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;How to disable the display of abbreviated tooltips? Customized tooltips do not need to be displayed repeatedly, as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2oeb1y6hs4yuhgmuemy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr2oeb1y6hs4yuhgmuemy.png" alt="Image description" width="574" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;VChart will automatically omit long text and provide an interactive floating display poptip to display the complete text by default. If you want to turn it off, you can set poptip: false in the parameter of the constructor function when initializing the chart, as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const vchart = new VChart(spec, { 
  // ...
  poptip: false, // Close poptip for omitted text
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const spec = {
  type: 'bar',
  width: 300,
  height: 250,
  data: [
    {
      id: 'barData',
      values: [
        {
          name: 'AppleAppleAppleApple',
          value: 214480
        },
        {
          name: 'Google',
          value: 155506
        },
        {
          name: 'Amazon',
          value: 100764
        },
        {
          name: 'Microsoft',
          value: 92715
        },
        {
          name: 'Coca-Cola',
          value: 66341
        },
        {
          name: 'Samsung',
          value: 59890
        },
        {
          name: 'Toyota',
          value: 53404
        },
        {
          name: 'Mercedes-Benz',
          value: 48601
        },
        {
          name: 'Facebook',
          value: 45168
        },
        {
          name: "McDonald's",
          value: 43417
        },
        {
          name: 'Intel',
          value: 43293
        },
        {
          name: 'IBM',
          value: 42972
        },
        {
          name: 'BMW',
          value: 41006
        },
        {
          name: 'Disney',
          value: 39874
        },
        {
          name: 'Cisco',
          value: 34575
        },
        {
          name: 'GE',
          value: 32757
        },
        {
          name: 'Nike',
          value: 30120
        },
        {
          name: 'Louis Vuitton',
          value: 28152
        },
        {
          name: 'Oracle',
          value: 26133
        },
        {
          name: 'Honda',
          value: 23682
        }
      ]
    }
  ],
  direction: 'horizontal',
  xField: 'value',
  yField: 'name',
  axes: [
    {
      orient: 'bottom',
      visible: false
    }
  ],
  label: {
    visible: true
  }
};

const vchart = new VChart(spec, { dom: CONTAINER_ID, poptip: false });
vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  API：&lt;a href="https://visactor.io/vchart/api/API/vchart#options"&gt;https://visactor.io/vchart/api/API/vchart#options&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  Github：&lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vchart</category>
      <category>visactor</category>
    </item>
    <item>
      <title>When using stacked bar charts, how to get all data in the same dimension as the clicked bar in the click event</title>
      <dc:creator>SimaQ</dc:creator>
      <pubDate>Fri, 10 May 2024 06:25:04 +0000</pubDate>
      <link>https://dev.to/simaq/when-using-stacked-bar-charts-how-to-get-all-data-in-the-same-dimension-as-the-clicked-bar-in-the-click-event-467o</link>
      <guid>https://dev.to/simaq/when-using-stacked-bar-charts-how-to-get-all-data-in-the-same-dimension-as-the-clicked-bar-in-the-click-event-467o</guid>
      <description>&lt;h2&gt;
  
  
  Title
&lt;/h2&gt;

&lt;p&gt;When using stacked bar charts, how to get all data in the same dimension as the clicked bar in the click event?&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;When using a stacked bar chart, how to get all the data in the same dimension as the clicked bar in the click event? For example, clicking on the first bar returns four pieces of data represented by the blue, cyan, red, and green legends.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb0fv8fo90zv58iszm2mc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb0fv8fo90zv58iszm2mc.png" alt="Image description" width="800" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;In VChart, you can first obtain the x-axis dimension information of the clicked column by listening to the click event of the column, then obtain the data of the current chart through the API or directly using the original data source (if you can get it), and then filter out the column data with the same x-axis dimension information. As follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Listen to the click event of the bar primitive
vchart.on('click', { markName: 'bar', level: 'mark' }, (e: any) =&amp;gt; {
  const datum = e.datum as any; // Get information about the clicked column
  const chartSpec = e.chart?.getSpec(); // If you can't get the current spec, you can get the original spec in this way.
  const xDimensionValue = datum[chartSpec.xField];
  const chartData = e.chart.chartData.getSeriesData().latestData; // If you can get the original data source, you can also get the original data source directly.
  const filterData = chartData.filter(chartDatum =&amp;gt; chartDatum[chartSpec.xField] === xDimensionValue);

  console.log(filterData);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const spec = {
  type: 'bar',
  data: [
    {
      id: 'barData',
      values: [
        {
          State: 'WY',
          Age: 'Under 5 Years',
          Population: 25635
        },
        {
          State: 'WY',
          Age: '5 to 13 Years',
          Population: 1890
        },
        {
          State: 'WY',
          Age: '14 to 17 Years',
          Population: 9314
        },
        {
          State: 'DC',
          Age: 'Under 5 Years',
          Population: 30352
        },
        {
          State: 'DC',
          Age: '5 to 13 Years',
          Population: 20439
        },
        {
          State: 'DC',
          Age: '14 to 17 Years',
          Population: 10225
        },
        {
          State: 'VT',
          Age: 'Under 5 Years',
          Population: 38253
        },
        {
          State: 'VT',
          Age: '5 to 13 Years',
          Population: 42538
        },
        {
          State: 'VT',
          Age: '14 to 17 Years',
          Population: 15757
        },
        {
          State: 'ND',
          Age: 'Under 5 Years',
          Population: 51896
        },
        {
          State: 'ND',
          Age: '5 to 13 Years',
          Population: 67358
        },
        {
          State: 'ND',
          Age: '14 to 17 Years',
          Population: 18794
        },
        {
          State: 'AK',
          Age: 'Under 5 Years',
          Population: 72083
        },
        {
          State: 'AK',
          Age: '5 to 13 Years',
          Population: 85640
        },
        {
          State: 'AK',
          Age: '14 to 17 Years',
          Population: 22153
        }
      ]
    }
  ],
  xField: 'State',
  yField: 'Population',
  seriesField: 'Age',
  stack: true,
  legends: {
    visible: true
  },
  bar: {
    // The state style of bar
    state: {
      hover: {
        stroke: '#000',
        lineWidth: 1
      }
    }
  }
};

const vchart = new VChart(spec, { dom: 'chart' });
vchart.renderSync();


// 监听 bar 图元的 click 事件
vchart.on('click', { markName: 'bar', level: 'mark' }, (e: any) =&amp;gt; {
  const datum = e.datum as any; // 获取被点击的柱子的信息
  const chartSpec = e.chart?.getSpec(); // 如果你无法获取当前的 spec，可以通过该方式获取原始 spec
  const xDimensionValue = datum[chartSpec.xField];
  const chartData = e.chart.chartData.getSeriesData().latestData; // 如果可以拿到原始数据，也可以直接拿原始数据
  const filterData = chartData.filter(chartDatum =&amp;gt; chartDatum[chartSpec.xField] === xDimensionValue);

  console.log(filterData);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3rde1iok9gb278w139d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd3rde1iok9gb278w139d.png" alt="Image description" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Documents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;  Tutorial: &lt;a href="https://visactor.io/vchart/api/API/event#%E4%BA%8B%E4%BB%B6%E8%BF%87%E6%BB%A4"&gt;https://visactor.io/vchart/api/API/event#%E4%BA%8B%E4%BB%B6%E8%BF%87%E6%BB%A4&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  API: &lt;a href="https://visactor.io/vchart/api/API/event#%E4%BA%8B%E4%BB%B6%E8%BF%87%E6%BB%A4"&gt;https://visactor.io/vchart/api/API/event#%E4%BA%8B%E4%BB%B6%E8%BF%87%E6%BB%A4&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  GitHub: &lt;a href="https://github.com/VisActor/VChart/"&gt;https://github.com/VisActor/VChart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vchart</category>
      <category>visactor</category>
    </item>
  </channel>
</rss>
