Skip to content

Commit

Permalink
fix: 修复官网条形图&进度条报错 (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
tangying1027 authored Aug 10, 2022
1 parent 4e7d922 commit 7a8d478
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/site/examples/pie/donut/demo/donut.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const data = [
];

const context = document.getElementById('container').getContext('2d');

const map = {};
data.forEach(function(obj) {
map[obj.name] = obj.percent + '%';
});
const { props } = (
<Canvas context={context} pixelRatio={window.devicePixelRatio} theme={{ padding: [20, 'auto'] }}>
<Chart
Expand Down Expand Up @@ -50,8 +53,8 @@ const { props } = (
/>
<Legend
position="right"
itemFormatter={(val) => {
return val + ' ' + map[val];
itemFormatter={(val,name) => {
return map[name];
}}
/>
</Chart>
Expand Down
2 changes: 1 addition & 1 deletion packages/site/examples/pie/donut/demo/progress-bar.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { Canvas, Chart, Interval, TextGuide, ArcGuide } from '@antv/f2';
import { jsx, Canvas, Chart, Interval, TextGuide, ArcGuide } from '@antv/f2';

const data = [
{
Expand Down

0 comments on commit 7a8d478

Please sign in to comment.