News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Bar Charts

Started by Biterider, December 24, 2021, 03:54:10 AM

Previous topic - Next topic

Biterider

Hi
For one of my projects, I need to display some data in the form of a bar chart.

Recently I showed the code for a super-fast XY chart. With that in mind, I refactored the code and added the necessary lines to draw the bars. I also customized the Series Setup tab for this type of chart.

In order to be able to read the data better, I added a tooltip to the float routine, which shows the series title, the description and the values. This behaviour can be switched on and off like the other features acting on the object flags on instance initialization. The code resembles the functionality of the InfoAreas implemented in TextView.

Since all these improvements were coded on the basic objects, the XY-Chart automatically gets them as well.  :thumbsup:

Attached are the new binaries demonstrating an XY-Chart and a Bar-Chart. The complete source code is on the code repository.

Have fun!

Biterider

HSE

Hi Biterider!

   I cloned all the project just 5 minutes before update  :biggrin: :biggrin: I cloned again

   Fantastic!  :thumbsup:   

   You only have to improve X axis  :biggrin: 

   Really unusual that kind of axis in more knows graphic programs   :rolleyes: (or I don't know how to do that)

   That must look something like:
Equations in Assembly: SmplMath

HSE

 :biggrin:  Same idea a little more complex.

I don't have installed any screen capture yet. Fortunatelly Hutch's ScrCap make the job  :thumbsup:

Apparently still work my now 20 years old program :eusa_snooty:
Equations in Assembly: SmplMath

Biterider

Hi HSE
Thanks for your feedback.  :thumbsup:

If you change the setting just a little, you can achieve something like in the attached picture.
But you are absolutely right, the x-axis can be done better.
This led me to further break up the rendering process, the way you can customize each element of the chart in child objects, like in this case.  :icon_idea:

Regards, Biterider

HSE

Equations in Assembly: SmplMath

Biterider

Hi
The code was prepared from the beginning to support an additional Y-axis (Y2 in the source code).
I will now spend some time implementing this.

It occurred to me that there might be a use case where you want to combine different types of plots into a single chart. I think it is possible to rearrange and refactor the code a little bit more to achieve this. Let's see how far I can get...  :cool:

Biterider

HSE

Hi Biterider!

Quote from: Biterider on December 25, 2021, 08:24:10 PM
The code was prepared from the beginning to support an additional Y-axis (Y2 in the source code).
Usually is easy to draw against another Y-axis, problem is to draw more numeric scales. I can use any number of Y-axis, but scales are difficult, specially with more than 2 Y-axis. Any way, I never saw a graphic with more than 6 Y-axis. A posibilty to make thing more clear is to use partial Y-axis

Quote from: Biterider on December 25, 2021, 08:24:10 PM
It occurred to me that there might be a use case where you want to combine different types of plots into a single chart. I think it is possible to rearrange and refactor the code a little bit more to achieve this. Let's see how far I can get...  :cool:
Great  :thumbsup:

Regards, HSE.
Equations in Assembly: SmplMath