How to change the font in visreg - visreg

I am trying to visualize an interaction effect between age and language use with Visreg. I would like to change the text font along side the x-axis, y-axis and by-axis into Times New Roman instead of Serif. Does anyone know how to do this? This is my current code:
visreg(m5, "Language_use", by= "Age", overlay = F)

Related

Can I add a moving scale or axis in plots using Vegalite?

I am trying to add a movable scale or axis inside a plot. For instance: in this example of stacked plot: Click-to-view
I want to include a movable y-axis scale so, if we hover the graph and put the mouse pointer on the beginning of the orange color of any bar, the a-xis will begin from that bar. (Specifically, moving x=0 line.)
I meant something like this example (of d3).
https://observablehq.com/#d3/index-chart
But, here I want to change the value of x-axis by moving the line. Is it possible to do it using vegalite? If somebody has any similar example in vegalite, can you refer it?
Thank you!
AFAIK, there is no animation in Vega Lite. However, you may check out Gemini which aims to extend the grammar of data viz to some simple animations of single-view Vega/Vega-Lite charts

How to create a vertical line on a certain date at x axis in Spotfire

Hi guys,
How to create a vertical line to a certain date on X axis? I found out that we will need to set x axis as
continuous scale to enable vertical line option...But this is not what I want. For example, I have attached a screenshot. I manually set the vertical line in August 2013...of course, this is not what i want to do (I can't manually input a date as i want the chart to analyze it), but that is the final look i want. I want the chart to read the date when it has the first water injection from well list i imported and then draw a vertical line on that date...From this date to future, it will be the waterflood period (it will be nice to somehow highlight this area in the chart with a light color but i dont know how to do it). Can somebody tell me what I need to do to achieve this and I do want x axis to be categorical scale as i want to show all dates.... Is there a custom curve script I can write? I assume i would need to write something like read the earliest date of the water injection and then draw a vertical line on this date...
Please help! Thanks!

Editing Chart Labels on Nativescript

I am developing a mobile application and currently working with charts (ScatterSeries to be more precise). By default, Nativescript shows the X and Y coordinates of Labels (showLabels="true"). Instead of this, I would like to display something different (let's say High, Medium, Low, etc...). I have looked for a property within labelStyle and ScatterSeries that will allow me to change this; but cannot find it (not sure this is the right approach).
PS: I am using this as a work-around since I couldn't figure a way to add a text to a certain area of the chart. So, if someone knows how to add a text label on a specific set of coordinates that will also do it.
Appreciate your help!

Chart-like object (but not a gantt or stacked bar chart) in d3 -- where to start?

I have a chart I've created in excel that I'd like to replicate in d3, but I'm not sure where I should begin.
It's intended to show which character is speaking at which moment during a play, and so it visually looks similar to a gantt chart or stacked bar chart but it isn't working off of time the way a gantt chart would. Am I right in thinking that it'd be a bar chart or series of bar charts? Could I build it up by a series of 1 pixel wide bars, so that each pixel would equal a line in the play?
I'd provide code but I tried to modify the standard stacked bar chart and all I've really been able to do is either make the whole thing blank or modify the canvas dimensions. So I'd appreciate some suggestions to get me started.
it seems to me that the only (and big!) trouble you'll have here is creating the JSON. Once you have the JSON, it will be a piece of cake! Here is what I thought:
Create a very big JSON that is just 1 big array of hundreds of objects. Each object would be like this:
{"character": "John Doe", "place": "tavern", "duration": 5}
Then, you'll append the narrow rectangles using an ordinal scale for the places ("place") on y axis, setting the x position according to the cumulative duration of previous speeches and setting the width using the duration of each speech, and using CSS you can color the bars according to the character (using character for setting the class).
For this, you would use D3 only for the scales, avoiding the typical selection().data().enter().append() pattern and appending each rectangle in a for loop. Let me explain. Suppose you put your JSON in a variable named data. Then, you do:
for (var i = 0; i < data.length; i++){
var speech = data[i]
//rest of the code
}
This allow you, for each loop, to know the y position of the bar using speech.place, the name of the character using speech.character, for the colors, and the duration of the line using speech.duration. For calculating the x position, you declare a var duration; outside the loop and, inside it, you write:
duration += speech.duration;
In this approach, once you would use the cumulative duration for x position, the objects in the array must to be in the exact chronological order of the play.
PS: D3 is so nice that you can create an additional value named "line", for each object, with the actual line spoken by the character, and when the user hover over the rectangle he/she will see the text of the speech!

Extending chart functionality in SSRS

The default chart object in the SQL Server (2005) Business Intelligence Development Studio doesn't seem to some have formatting options like :
specifying the text direction of labels in the x and y axis
adding a trendline to a bar chart
arbitrarily resizing items in a chart - for example, if I resize the chart object, everything gets resized accordingly but I can't keep the size of the chart the same while extending the area of the legend for instance.
multiline chart labels
So what I want to know is
is there any easy answer to the formatting problems mentioned above?
what websites/books/resources/examples would you recommend I look
into for extending the functionality of the chart object?
Some colleagues of mine gave up on the stock control and bought Dundas charts
The stock charts are cut down versions of Dundas.
yes you can specify the text direction of labels in the x and y axis
Go to chart properties and in the tab x and y axis enter the chart title and in the title align use the combination like left/right/center align.
you can change the legend line go to the chart properties click legend tab inside this
there is an option for "display legend inside plot area" and you can include the trendline there
you can use multiline text labels when the text limits extends
I don't see how you can resize the legend, puting inside the plot area looks ugly for pie-chart
I'd recommend go with the dundas chart components gbn suggested.
If that's not possible at least this article should solve issue 1.

Resources