ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  How to display all xLabel value in chart?
Posted by Eva on Sep-07-2017 18:11
Hi, all

I use it to show the xLabel value in chart.

Call layer.setHTMLImageMap("", "", "title='{xLabel}: {dataSetName} {value}'")

But I want to show all value and dataSetName on xLabel.

Is there any way to do this?

  Re: How to display all xLabel value in chart?
Posted by Peter Kwan on Sep-08-2017 00:55
Attachments:
Hi Eva,

I am not too sure what you mean by "show all value and dataSetName on xLabel".

For the setHTMLImageMap code, it should display the x-axis label, dataSetName and the value of the data representation (the data representation is a line segment for line chart, bar for bar chart, point for scatter chart, etc) in a pop-up tooltip. Is this working normally?

By "show all value and dataSetName on xLabel", do you mean when the mouse is over an x-axis label, you want to show some values and data set names? I have attached a typical chart, would you mind to clarify what do you want to show when the mouse is over the x-axis label "0", "5" and "10"?

If the above is not what you want, would you mind to clarify the behaviour you want?

Regards
Peter Kwan
scatter.png

  Re: How to display all xLabel value in chart?
Posted by Eva on Sep-08-2017 09:44
Hi, Peter.

I am sorry about my bad English.

I want when the mouse is over the x-axis label "30", It will show stage1 and stage2 value.

Because seems like they have same x-axis.

I have two data set in my layer.

I want to show two y-axis value when they have the same x-axis.

Let me know if there is something unclear.

  Re: How to display all xLabel value in chart?
Posted by Peter Kwan on Sep-08-2017 22:05
Attachments:
Hi Eva,

Sorry, in my last message, I attached the wrong image. I was thinking about the scatter chart below. As you can see, there is no data point at x = "5", two data points at x = "10" and 1 data point at x = "15". Most of the data points do not have x-axis labels.

Anyway, from the description in your last message, I think what you would like to do is like the Programmable Track Cursor. See:

http://www.advsofteng.com/doc/cdnet.htm#tracklabel.htm
http://www.advsofteng.com/doc/cdnet.htm#trackbox.htm

The programmable track cursor sample code displays the x-axis label and all data values in all data sets that are at the mouse x position.

The sample code for the above is available for both web and desktop applications. For web applications, they are included in all programming language editions of ChartDirector except C++. For the desktop sample code, they are included in the C++, .NET and Java edition of ChartDirector.

If you need further help, would you mind to clarify if the "Programmable Track Cursor" above is what you need, which programming language edition of ChartDirector you are using, and whether you are writing a web or desktop application.

Regards
Peter Kwan
scatter.png

  Re: How to display all xLabel value in chart?
Posted by Eva on Sep-11-2017 09:38
Hi, Peter

"Programmable Track Cursor" is exactly what I need.

But I am writing a desktop application with VB6.

I check another Message you answered before:

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&pattern=Track+Cursor+VB6&thread=1457101755#N1457351538

But this code not work for me.

My chartdirector doesn't have "initDynamicLayer" function.

I guess the reason is my chartdirector version is too old.(v4.1)

But due to some reason, I can't upgrade the version casually.

So I just wondering if I can show the value using "setHTMLImageMap" or other way?

  Re: How to display all xLabel value in chart?
Posted by Peter Kwan on Sep-12-2017 01:27
Attachments:
Hi Eva,

For VB6 and ChartDirector 4.1, you can try the following method:

(a) In the mouse move event handler, you can obtain the x data position of the mouse from the x mouse coordinate.

(b) Once you know the x data position, you can obtain the x-axis labels and data values with your own code. You can then display them using a normal VB6 TextBox and put the text box near your mouse. You can also use a control that is 1 pixel wide to act as the vertical track line.

I have attached an example for your reference.

Hope this can help.

Regards
Peter Kwan
vb6TrackCursor.zip
vb6TrackCursor.zip

2.25 Kb

  Re: How to display all xLabel value in chart?
Posted by Eva on Sep-12-2017 14:21
Hi, Peter

Thanks for your help.

Although I can't run the attachment because I don't have getPlotArea() function.

But I understand what you mean so I will try to show the value in textbox.

Thanks again!