使用chart.addAxis并为折线图上的水平线定义标题,标题被反转

发布于 2024-11-07 10:49:57 字数 854 浏览 4 评论 0原文

如何使用 Chart.addAxis 方法定义一个不会在折线图水平轴上反转的标题。目前我的代码如下所示。发生的情况是,当渲染“X 轴”时,它会上下颠倒。

Chart1.setTheme(dojox.charting.themes.ThreeD);

chart1.addAxis("x", {
  title: 'X Axis',
  range: { lower: 0, upper: 70},
  //to enable scaling of ticks
  //majorTickStep: 4,
  //minorTickStep: 2,
  //microTickStep: 1
  //to enable min and max range
  //min: 0,
  //max: 10,
  showTicks : true,
  min: 0,
       max: 10,
  fixLower: "major", 
      fixUpper: "major",
      majorTick: { stroke: "black", length: 3 },
      minorTick: { stroke: "gray", length: 3 }
});
chart1.addAxis("y", {
  title: 'Y Axis',
      vertical: true,
  scale: 2 ,
  showTicks : true,
      fixLower: "major", 
      fixUpper: "major",
      majorTick: { stroke: "black", length: 3},
      minorTick: { stroke: "gray", length: 3 },
  //htmlLabels: false
});

How do you define a title that will not be inverted on the horizontal axis of a line graph, using the chart.addAxis method. Currently my code is seen below. What happens is when the "X Axis" is rendered it is inverted upside down.

chart1.setTheme(dojox.charting.themes.ThreeD);

chart1.addAxis("x", {
  title: 'X Axis',
  range: { lower: 0, upper: 70},
  //to enable scaling of ticks
  //majorTickStep: 4,
  //minorTickStep: 2,
  //microTickStep: 1
  //to enable min and max range
  //min: 0,
  //max: 10,
  showTicks : true,
  min: 0,
       max: 10,
  fixLower: "major", 
      fixUpper: "major",
      majorTick: { stroke: "black", length: 3 },
      minorTick: { stroke: "gray", length: 3 }
});
chart1.addAxis("y", {
  title: 'Y Axis',
      vertical: true,
  scale: 2 ,
  showTicks : true,
      fixLower: "major", 
      fixUpper: "major",
      majorTick: { stroke: "black", length: 3},
      minorTick: { stroke: "gray", length: 3 },
  //htmlLabels: false
});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

简美 2024-11-14 10:49:57

set titleOrientation: "away"

请参阅文档< /a>

参数: titleOrientation
类型:字符串
默认:
描述:确定标题相对于轴的方向,通过“axis”面向轴,通过“away”背向轴。

set titleOrientation: "away"

See the documentation

param: titleOrientation
type: string
default: axis
description: determine the title orientation to the axis, facing to the axis by "axis", or facing away from the axis by "away".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文