当前位置: 首页 > 工具软件 > JScharts > 使用案例 >

EXT.js charts的属性——折线图

甄华清
2023-12-01
  1. insetPadding(画布的内边距)
a、insetPadding:20,
b、insetPadding:{
	top:20,
	right:20
}
  1. innerPadding(图表的内边距)
a、innerPadding:20,
b、innerPadding:{
	top:20,
	right:20
}
  1. sprites(画布内,可以放标题)
sprites: [
     {
       type: 'text',
       text: '折线统计图',
       fontSize: 18,
       width: 100,
       height: 30,
       x: 100, 
       y: 20, 
     },
]
  1. axes(轴的配置)
axes: [
  // Y轴
  {
    type: 'numeric',
    position: 'left',
    grid: true,
    minimum: 0,
    maximum: 100,
  },
  // X轴
  {
    type: 'category',
    position: 'bottom',
    grid: true,
    label: {
      rotate: {
        degrees: -45,
      },
    },
  },
],
  1. series(图表配置)
series: [
   {
     //   图表类型,此处是折线图
     type: 'line',
     // x轴变量
     xField: 'month',
     // y轴变量
     yField: 'data1',
     // 图表样式
     style: {
       lineWidth: 2, //线的宽度
       stroke: 'red', //  线的颜色
       'stroke-width': 0,
       color: '#2695df', //  散点的颜色
     },
     marker: {
       radius: 4, //散点的radius
       strokeStyle: '#ccc', // 散点晕的颜色
     },
     label: {
       field: 'data1',
       display: 'over',
     },
     // 高亮样式
     highlight: {
       fillStyle: '#000',
       radius: 5,
       lineWidth: 2,
       strokeStyle: '#fff',
     },
     // 提示框
     tooltip: {
       trackMouse: true,
       showDelay: 0,
       dismissDelay: 0,
       hideDelay: 0,
       renderer: 'onSeriesTooltipRender',
     },
   },
],
 类似资料: