Android Question (Solved) Kindly Help me on this XChart Dataset Issues

omo

Active Member
Licensed User
Longtime User
b1.jpg


Looking at the diagram above:
1. If i have my own array/list of numbers i.e data: [10, 41, 35, 51, 49, 62, 69, 91, 148] for y-axis and categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'] for y-axix for line chart or yx-chart, how can i use my own array like done in most chart-js/apexchartjs html charts?

2. From the diagram above, vertical line indicated with letter A which usually appears when line chart or yx-chart is touched. What is the name of that line called in xchart library? Can it be customized by changing its stroke width, color and type to i.e dash-dash line?

3. Aside being vertical, how can its horizontal line be drawn at the same time or horizontal fixed while vertical line may not be fixed?
 
Last edited:
Solution
1. You need to fill the chart yourself for both axes, there is no method to set it directly.
Example below

2. The vertical line is called Cursor, its color is red not configurable.

3. Sorry, but i do not understand exactly your question.

When you add a chart in the Designer do not forget to set the chart type to LINE:

1701606415737.png


Difference between LINE and YX_CHART charts.
LINE chart:
The X axis ticks are Strings, the Y axis ticks are Double variables.
For each tick on the X axis you can have several Y values, one for each line.
The cursor has only the vertical line.

YX_CHART:
The X and Y axis ticks are Doubles.
Each point has a X and a Y value, it can belong to a line or not.
The cursor has the vertical line and a horizontal...

klaus

Expert
Licensed User
Longtime User
1. You need to fill the chart yourself for both axes, there is no method to set it directly.
Example below

2. The vertical line is called Cursor, its color is red not configurable.

3. Sorry, but i do not understand exactly your question.

When you add a chart in the Designer do not forget to set the chart type to LINE:

1701606415737.png


Difference between LINE and YX_CHART charts.
LINE chart:
The X axis ticks are Strings, the Y axis ticks are Double variables.
For each tick on the X axis you can have several Y values, one for each line.
The cursor has only the vertical line.

YX_CHART:
The X and Y axis ticks are Doubles.
Each point has a X and a Y value, it can belong to a line or not.
The cursor has the vertical line and a horizontal line, its color is black.

Attached a small test program for a LINE chart with the values like in your post.

1701606053115.png

Both charts use automatic scales.
In the upper chart the min value is negative.
To make it look better i selected YZeroAxis in the Designer for the bottom chart.

1701606482664.png
 

Attachments

  • NewLineChart.zip
    10.4 KB · Views: 124
Upvote 1
Solution

omo

Active Member
Licensed User
Longtime User
Thank you @klaus for that simplicity. I got the message well. I have been able to add YXchart to your two line charts above by using another sets of x, y double arrays and changing chart type. I have gotten answer to No3 question from your explanation on YXchart. I am now clear with weather to use line or YXchart. Thank you so much, regards
 
Upvote 0
Top