Select Point From Chart

Yafuhenk

Active Member
Licensed User
Longtime User
Hi Experts,

Is there something possible like the following VB6 code in B4A?
I want to select a bar in the chart and then make a SQL with the datapoint.

The following is just a VB6 example:

Private Sub Chart1_PointSelected(Series As Integer, DataPoint As Integer, MouseFlags As Integer, Cancel As Integer)

Chart1.Row = DataPoint
Chart1.ToolTipText = Chart1.RowLabel & " " & Format(Chart1.Data, "#,#0")
SQL = "Select A1.NAME, SUM(A2.TURNOVER) From CUSTOMERS A1, MATERIALS A2 Where A2.MONTHYEAR = #" & Format(Left$(Chart1.ToolTipText, 8), "MM/DD/YYYY") & "# And " & Text1.Text & " And A1.CUSTOMER = A2.CUSTOMER GROUP BY A1.NAME"

End Sub

As far as I can see with Chart example of B4A one can not select a Datapoint


Thanks

Henk
 

klaus

Expert
Licensed User
Longtime User
Unfortunately the information you give is not sufficient.
Is Chart1 based on the SQL ? I presume yes.

So from the principle point of view it is be possible.
You can have a kind of chart display with a ScrollView, examples do exist in the forum.
There you can select any cell and do what you want with the result.

Best regards.
 
Upvote 0

Yafuhenk

Active Member
Licensed User
Longtime User
Hi Klaus,

I know these examples.
Your remark about combining scrollview with the charts examples gave me some ideas.
I´ll give it a try

Thanks

Henk
 
Upvote 0
Top