How would a generic type of timeline chart be called? - charts

I am pretty sure there is a library out there that could support the type of visualization that I want - I think I just have a problem with terminology, and therefore cannot look up the right thing ...
So, considering this type of JSON data:
var TestData = [
{category: "c_one", label: "item A", start: 0, end: 99999},
{category: "c_one", label: "item B", start: 100500, end: 100509},
{category: "c_two", label: "item C", start: 200000, end: 249999}
];
... I would like to obtain an interactive chart (HTML/JS would be great, but any interactive display would be fine), where:
The "start" and "end" are generic numbers (integers/floats); and mapped to the abscissa (x-axis) which is horizontal
Height and width dimensions of the plot/chart are freely configurable (e.g. width up to 94% of browser width, height 200 px)
At start, the entire range covered by all items in the data is shown;
Afterwards the user can zoom in (and out) the abscissa using mouse wheel - and can drag the chart left and right with mouse drag
An item is then a filled (and possibly stroked) rectangle, from "start" to "end" along the abscissa as the width, and taking up the entire height of the chart
When a given item is within currently shown range, but is too short/thin to be visualized on current zoom level, at least some sort of a visual indication is given (say, a vertical line)
If an item rectangle is wide enough, then:
the start number is indicated on its left edge, the text being "vertical" (rotated counterclockwise), non sticky label (disappears as soon as the start location is out of view, even if the rest of the item is visible) - there are otherwise no ticks on the abscissa
The label is rendered if there is enough space to render at least N (say 3) characters; shown on center of item rectangle, but otherwise sticky (i.e. if most of the item is out of view, and only a part of its right end is shown which is wide enough for 3 characters, then the label is rendered there - even though that is not "center" of the rectangle anymore)
Hover/mouseover over a part of a rectangle raises a small popup that can shows entire entry (category, label, start and end), through a configurable string format
Category mappable to e.g. background color (through an intermediary dict)
Closest I got to this is a Timeline chart - I managed to get the below image rendered with https://github.com/denisemauldin/d3-timeline (and then added the labels in GIMP as an example):
The problem with a Timeline chart is:
The abscissa values/ranges are expected to be dates (coincidentally, d3-timeline does allow you to enter integers for the start and end ranges, but they have the specific meaning of Unix timestamps)
One cannot typically position labels inside the "item rectangle"
( Specifically for d3-timeline, fonts for tick labels are also scaled depending on zoom level (quickly gets ugly) - and it is extremely hard for me to set desired width and height of the chart )
Looking into, say, https://chartio.com/learn/charts/essential-chart-types-for-data-visualization/, this kind of "generic timeline" chart can be seen as similar to:
Stacked bar chart - except there, the data is shown "vertically", and "horizontally" there are groups
It could also be seen as a pie/donut chart, except "linearized" (horizontally) - and the abscissa would not have dimension of "percentage"
... but neither of those quite fit, in my opinion (and "generic timeline" is awful as a name, since this has nothing to do with "time" - but I couldn't think of anything better).
So, what would be the name for this kind of a chart - sort of like a timeline, except the abscissa does not have the dimension of date/time, but instead just a generic number?

Related

How to add scroll to x-axis displaying date in Charticulator?

I am trying to make a specific form of gantt-chart in Charticulator for display in Power BI. The diagram consists of:
X-axis: Start datetime for the assignment
Y-axis: group member
Width of mark: Number of minutes assignment is estimated for
Color of mark: Type of assignment
See example
Here's the problem:
As soon as I tick off the "Allow Scroll" for X-axis, all data marks disappears, and the settings for the axis changes to seemingly only have data for one day. The glyph also becomes blank with the text "to edit this glyph please add a plot segment to it", even though I just had a plot segment before selecting "Add scroll". This is only a problem for data with datetime, not if I change it to a string, which unfortunately would create other issues.
Before adding scroll
After adding scroll
Does anyone have a fix to create a x-axis with datetime with scroll?

Make contour labels point uphill: reverse direction of text label on line feature

I am designing a map in Mapbox Studio, using mapbox.mapbox-terrain-v2’s contour layer to determine the contour lines. This is based on the outdoors style.
In the outdoors style, the contour labels are oriented so that the text is displayed between -90° and 90° of horizontal, because Keep Text Upright is set. If I disable this, then the text becomes oriented at any angle. However, this text is oriented at exactly the opposite angle to what I would like: it always points downhill, not uphill. See first image below: note that the numbers are upright where the elevation increases from north to south.
What I am aiming for is to use the Ordnance Survey style of orienting numbers uphill (upright where the elevation increases from south to north), as in the second image below.
My current style can be seen here. I have tried using the text-rotate field, but this rotates each character individually, and there does not appear to be a function to reverse the string to counteract this. Additionally, this rotates about the top of each letter, meaning that the result is offset from the actual contour line, and text-translate + text-translate-anchor seem unable to resolve this.
As you noticed, using text-rotate on a symbol layer with placement: line rotates each character individually. So you would need to then reverse the string, which isn't possible within the expressions available.
However. There is one hacky workaround which may solve the problem for you. You can simply hardcode all the possible elevations with their reversals:
["match", ["get", "ele"],
750, "m057",
700, "m007",
650, "m056",
600, "m006",
550, "m055",
500, "m005",
""
]
Combined with a text-offset of 0,1.5, this actually looks alright:
I've published the style here

Coordinate system in Crystal Reports

I'm working with CR version 13.0.25 - I believe the actual latest version as of this date is 13.0.26, so, basically the latest version of CR. What I am working with is re-positioning elements on the report dynamically from the C# code.
There are a couple of the reports where the original rpt (designed a number of years ago) spans multiple pages. These in particular are giving me issues, but they are not the only ones. The issue here focuses on the y (vertical) dimension.
CR documents use a coordinate system that is based in the upper left corner of the document, and is also based on twips (1440 twips/in). So, in theory, I should be able to set the Top value for a ReportObject to 1440 and that element should be printed 1" from some benchmark (either top of the page or bottom of the margin - I'm fairly sure it's bottom of the margin).
My results do not seem to reflect this - at least not exactly.
When I set the Top value, it appears that with some of the documents, the y dimension is scaled. In fact, I can apply a constant scaling factor (it varies according to the document) and I can make the fields appear with a relative 1" spacing all of the way to the bottom of the page. However, that scaling factor varies from document to document.
So, besides experimenting in our production code, I have also done the following:
I created a C# console app that opens an rpt file, grabs some of the elements on it, and re-positions them, then sends it to the printer. I designed a new rpt file with headers and footers sized as small as I could get them, and put 10 text fields in the details section. I iterate through the fields (via ReportDocument and ReportObjects and re-position them at 0, 1440 (1"), 2880 (2") etc.
This works perfectly with a document that has the default margins (.167 inches by default on each side). The first element has its top butted against the bottom of the margin, the second element is 1" from the top of the first element to the top of the second element, and so on down the page. If, however, I reduce the margins to zero - either programmatically or in the design, I get this scaling effect. The elements are all now about 7/8" or so apart, instead of the 1" that I would expect.
Does anyone know of any magic formula(s) or documentation on why the coordinate system appears to be changing? I could understand that if I change the margin that could offset everything on the page (assuming that the margin is our baseline) but it would seem to me that the inter-element spacing, being 1440 should still render at 1".
I believe Y is the vertical distance from the top of that section, not from the top of the page.

Get absolute position in frame

The way I understand how emacs displays stuff is that essentially everything is text. If you have something in the fringe or linum mode active, essentially your document is pushed a little inwards and something is written in the first few columns.
I'm writing a function for putting some stuff into the head-line and this works nicely, however, I would like the start of the text to be aligned with the start of the document.
Thus I am looking for a way to get the number of columns that sit between the frame border and the start of the actual document.
Let me illustrate using a poorly produced graphic:
I want to get the number of columns (or the number of pixels) that make up the distance marker by the ruler just below the line number 10000.
The function which returns this value shall be executed in the functions which create the head-line.
There is a function called window-inside-edges that you can use to determine the offset of the text area ("window body") from the total width and height of the window in columns and lines, respectively.
It returns a list four values; the order is left - top - right - bottom, so to get the value you are interested in for the current window, just do
(car (window-inside-edges))
More information on window coordinates can be found here; this page has information about window sizes, including a nice ASCII representation of window elements.

SSRS overlapping column chart

currently i have the following chart:
It currently contains one column (blue one) and a range column (white one). But what i really need is a chart which looks like the following:
So the white column should be overlapped by the blue column. I tried to change the range column to a normal column and changed the "CustomAttribute" PointWidth but was not able to get my chart looking like the needed chart.
Does somebody knows how to do that? Thanks
#glh: I know that, it currently looks like this (changing the white range to column):
ANGEFALLEN = blue column
EINGEPLANTV1 = white column
Problem is that the white column is now right to the blue column.
If i change the order of the chart data the blue column ins right to the white column. But i need the white column to be behind the blue column like shown in the second picture of the main post / question.
Followup 25.04.2013:
The chart should look like this:
I need to move 1/3 of the white column behind the blue column so that 2/3 of the white column is still visible. The blue column has to be in the foreground and the white column in the background.
Overlapping Series:
Change the "overlapping" series to a "Range Column" chart type. This will allow you to layer the two series on top of each other.
Once you do this, you will notice that the series will get two value drop-downs:
Set the "Low" drop down to an expression with the value of 0.
Set the "High" drop down to the value you would like to represent.
Offset Series Position:
I am actually not sure if this is possible in SSRS. However, you can play with the widths of the layered series to achieve a similar effect.
Set the PointWidth propety of the series (under CustomAttributes) either larger or smaller than the default .08, depending on your desired effect.
Here is a quick mockup I put together. It isn't exactly what you were looking for, but maybe it'll get your creative brain juices flowing.
You should be able to drag the values around in the values box or there will be a blue up or down arrow to alter the order your data is displayed. See below for an example of what you will see when you select the charts data.