1. legend: {
    2. show: true, //是否显示
    3. type: "plain", // 图例的类型 'plain':普通图例 'scroll':可滚动翻页的图例
    4. zlevel: 1, // 所有图形的 zlevel 值。
    5. icon: "circle",
    6. top: "5%", // bottom:"20%" // 组件离容器的距离
    7. right: "5%", //left:"10%" // // 组件离容器的距离
    8. width: "auto", // 图例组件的宽度
    9. height: "auto", // 图例组件的高度
    10. orient: "horizontal", // 图例列表的布局朝向。 'horizontal' 'vertical'
    11. align: "auto", // 图例标记和文本的对齐
    12. padding: 5, // 图例内边距
    13. itemWidth: 6, // 图例标记的图形宽度。
    14. itemGap: 20, // 图例每项之间的间隔。
    15. itemHeight: 14, // 图例标记的图形高度。
    16. symbolKeepAspect: true, // 如果图标(可能来自系列的 symbol 或用户自定义的 legend.data.icon)是 path:// 的形式,是否在缩放时保持该图形的长宽比。
    17. formatter: function (name) {
    18. return '{a|text}{a| }{b|' + name + '}'
    19. },
    20. selectedMode: true, // 图例选择的模式,
    21. inactiveColor: "#ccc", // 图例关闭时的颜色。
    22. textStyle: {
    23. color: "#556677", // 文字的颜色。
    24. fontStyle: "normal", // 文字字体的风格。
    25. fontWeight: "normal", // 文字字体的粗细。 'normal' 'bold' 'bolder' 'lighter' 100 | 200 | 300 | 400...
    26. fontFamily: "sans-serif", // 文字的字体系列。
    27. fontSize: 12, // 文字的字体大小。
    28. lineHeight: 20, // 行高。
    29. backgroundColor: "transparent", // 文字块背景色。
    30. borderColor: "transparent", // 文字块边框颜色。
    31. borderWidth: 0, // 文字块边框宽度。
    32. borderRadius: 0, // 文字块的圆角。
    33. padding: 0, // 文字块的内边距
    34. shadowColor: "transparent", // 文字块的背景阴影颜色
    35. shadowBlur: 0, // 文字块的背景阴影长度。
    36. shadowOffsetX: 0, // 文字块的背景阴影 X 偏移。
    37. shadowOffsetY: 0, // 文字块的背景阴影 Y 偏移。
    38. // width: 50, // 文字块的宽度。 默认
    39. // height: 40, // 文字块的高度 默认
    40. textBorderColor: "transparent", // 文字本身的描边颜色。
    41. textBorderWidth: 0, // 文字本身的描边宽度。
    42. textShadowColor: "transparent", // 文字本身的阴影颜色。
    43. textShadowBlur: 0, // 文字本身的阴影长度。
    44. textShadowOffsetX: 0, // 文字本身的阴影 X 偏移。
    45. textShadowOffsetY: 0, // 文字本身的阴影 Y 偏移。
    46. rich: {
    47. a: {
    48. color: "red",
    49. lineHeight: 10,
    50. },
    51. b: {
    52. color: "#fff",
    53. lineHeight: 10,
    54. },
    55. }, // 自定富文本样式
    56. },
    57. },