Author Topic: Bar Charts  (Read 999 times)

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 975
  • ObjAsm Developer
    • ObjAsm
Bar Charts
« on: December 24, 2021, 03:54:10 AM »
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

  • Member
  • *****
  • Posts: 2193
  • AMD 7-32 / i3 10-64
Re: Bar Charts
« Reply #1 on: December 24, 2021, 06:53:01 AM »
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

  • Member
  • *****
  • Posts: 2193
  • AMD 7-32 / i3 10-64
Re: Bar Charts
« Reply #2 on: December 24, 2021, 07:45:50 AM »
 :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

  • Moderator
  • Member
  • *****
  • Posts: 975
  • ObjAsm Developer
    • ObjAsm
Re: Bar Charts
« Reply #3 on: December 24, 2021, 05:33:01 PM »
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

  • Member
  • *****
  • Posts: 2193
  • AMD 7-32 / i3 10-64
Re: Bar Charts
« Reply #4 on: December 24, 2021, 11:19:10 PM »
 :thumbsup:
Equations in Assembly: SmplMath

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 975
  • ObjAsm Developer
    • ObjAsm
Re: Bar Charts
« Reply #5 on: December 25, 2021, 08:24:10 PM »
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

  • Member
  • *****
  • Posts: 2193
  • AMD 7-32 / i3 10-64
Re: Bar Charts
« Reply #6 on: December 26, 2021, 05:36:46 AM »
Hi Biterider!

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

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