microsoft / charticulator

Interactive Layout-Aware Construction of Bespoke Charts
Other
833 stars 115 forks source link

Glyph width is not displayed correctly #1017

Open powerofdata2022 opened 2 years ago

powerofdata2022 commented 2 years ago

Hello everyone,

I'm pretty new to Charticulator and I'm currently trying to build my first visual. I've already tried to find a solution for my problem in the official PowerBI community, but got the advice there to post it here as well.

The idea is fairly easy: I have several data points for software codes that need a certain time to run. I now want to put all those data points as rectangles onto a visual in which the position on the X-axis is determined by the start-time of the code ("StartPoint" - numerical value) and the width of the rectangle should be the runtime of the code ("Time" - also a numerical value). The position on the Y-axis is determined by another value (also numerical), which is not of concern here since this part already seems to work.

I therefore created a visual with a plot in which the x-axis represents the "StartPoint" and the y-axis represents the beforementioned value. The width of the glyph is connected to the "Time". Glyph

However, the width of the glyph is not displayed correctly in the visual. Runtime

As you can see in this screenshot, the highlighted rectangle should start at 135.49 (which is correct) and then have a width of 67.15, so that it ends at 202.64. Instead, it ends way earlier just before 160.

I have the same issue for all data points. Have I missed something or configured the glyph/plot incorrectly? Or do you have an idea how to solve this?

Thank you in advance. Please don't hesitate to ask if you have any questions.

Best regards

zBritva commented 2 years ago

image

  1. Use Data Axis
  2. Add avg(START) to data expressions
  3. Add avg(START) + avg(END) to data expressions.
  4. avg(0) is optional
  5. Bind Rectnagle to Data Axis start and end points
powerofdata2022 commented 2 years ago

Hey @zBritva,

thank you for the suggestion! However, this did not really solve the problem. I tried to apply all of the steps but the width is still displayed incorrectly. Screenshot_1 Screenshot_2 If I add "avg(StartPoint) + avg(EndPoint)" as the second data expression, it gets even worse because all the boxes in the chart disappear completely (or at least shrink down to a size so that you literally cannot see them).

Have I did anything wrong? Do you have any other suggestions on how to handle this?

Best regards

zBritva commented 2 years ago

Don't use Plot segment axis when you have Data axis. They aren't aligned.

powerofdata2022 commented 2 years ago

Great, thanks a lot, that looks good now! Is there a chance to include a y-axis that shows the Start-Points? So far, with this solution, there is no y-axis which makes it a bit hard to read the chart Screenshot_3 .

zBritva commented 2 years ago

Set required values to

Visible On property:

image

and Position property

image

of Data Axis