chart.js 938 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import {
  2. Chart,
  3. Interval,
  4. Axis
  5. } from '@antv/f2';
  6. import {
  7. jsx as _jsx
  8. } from "@antv/f2/jsx-runtime";
  9. import {
  10. jsxs as _jsxs
  11. } from "@antv/f2/jsx-runtime";
  12. export default (({
  13. data
  14. }) => {
  15. return _jsxs(Chart, {
  16. data,
  17. scale: {
  18. tem: {
  19. tickCount: 5,
  20. },
  21. },
  22. children: [
  23. _jsx(Axis, {
  24. field: "value",
  25. tickCount: 12
  26. }),
  27. _jsx(Axis, {
  28. field: "label"
  29. }),
  30. _jsx(Interval, {
  31. x: "label",
  32. y: "value",
  33. color: "value",
  34. adjust: "dodge",
  35. style: {
  36. field: 'value',
  37. radius: (val) => {
  38. return val > 0 ? [4, 4, 0, 0] : [0, 0, 4, 4];
  39. },
  40. }
  41. })
  42. ]
  43. });
  44. });