Fill gradient color in area under line chart in Protovis 3.2 - gradient

In my project, I use Protovis 3.2 to render line chart.
I want to fill gradient color in the area under line chart. Although I have tried available color functions in Protovis but they did not work.
Is there any simple solution for this problem?
Below is my code to add area into line chart
addArea: ->
self = this
#vis.add(pv.Area)
.data(self.data[0].values)
.bottom(1)
.left((d) -> self.xAxisUnits(d.index))
.height((d) -> self.yAxisUnits(d.value))
.fillStyle(pv.ramp('black', 'red'))
.anchor("top")
.add(pv.Line)
.lineWidth(2)
.strokeStyle("#78B9E2")
this

Sorry, but I'm pretty sure Protovis has no support for gradient fills. You might try D3.js, which doesn't support gradients out of the box but offers lower-level access to the SVG element, which you can use to define an svg:linearGradient fill.

Related

Changing size and color of labels in Bokeh high level charts

Is there a way to change or manipulate the font size and color of the labels in Bokeh high level charts like the Chord chart?
Bokeh provides options to change the background color etc, but I cannot seem to find any means to tweak the labels either in Bokeh or in css.
Any help or suggestion would be greatly appreciated.
In order to change the text size and color you have to alter the glyphs inside the chord chart renderers. The renderer in index position 3 is the text glyph renderer so you can set the font size and color there.
chord_from_df = Chord(source_data, source="name_x", target="name_y", value="value")
chord_from_df.renderers[3].glyph.text_font_size['value'] = '12pt'
chord_from_df.renderers[3].glyph.text_color = '#FF0000'
show(chord_from_df)

Changing tick label colour in mpld3

I am trying to plot stuff using matplotlib and mpld3. This is the code I use to generate my graph:
_fig = plt.figure()
_pl = _fig.add_subplot(111)
_pl.plot(_times, _values)
_pl.set_xlabel("Time")
_pl.set_ylabel("Value")
_pl.tick_params(direction="out", axis="both", colors="white", which="both")
_pl.xaxis.label.set_color("white")
_pl.yaxis.label.set_color("white")
_data = mpld3.fig_to_html(_fig)
.... send to client to be rendered
A graph is created and all the dynamic controls work. "Time" and "Value" labels get printed in white but tick labels in black.
If I skip mpld3 and test it with plt.show(), all tick labels get printed in white. When I check the javascript code generated by mpld3, I do not seem to detect the colour setting there for tick labels.
If I use another parameter, like font size, in tick_params it does have an effect. Only the colour gets ignored, which causes the labels to be printed in black on a dark blue background.
How do I change this?
Edit:
When inspecting the actual page rendered, there seems to be a "fill" property that determines the colour.
div#fig_el249691400950908834083380374260 .mpld3-xaxis text
{font-family:sans-serif; font-size:10px; fill:black; stroke:none; }
I tried overriding this in css but I could not figure out how to do it. This seems to override whatever I set elsewhere. It appears mpld3 sets the colour of the tick label, but how do I modify this?
Hannu
mpld3 only supports a subset of matplotlib's full capabilities, and tick formatting is one of the many things that is not yet supported. There is a partial list of these missing features on the mpld3 wiki.

BIRT: Gradient Across Chart instead of Bars

I want to style my chart in BIRT Designer Pro such that I have a color gradient moving across the bars. I know this can be accomplished using the format chart editor and adjusting the series palette to have a color gradient, but this doesn't achieve quite what I want to accomplish. My chart looks like this currently: You can see that the gradient moves across all the bars from start to finish no matter how long the bars are. In reality, what I want to accomplish can be seen in this Photoshop render:
In this image you can see how the gradient depends on how long the bar is and does not extend all the way between both colors of the gradient. Is it possible to do something like this in BIRT via scripting?
This turned out to be very simple to fix in the BIRT Designer. All that was needed was a custom theme with the following Highcharts.js needed to style it:
color: {
linearGradient: [0, 0, 0, '100%'],
stops: [
[0, '#FCB314'],
[1, '#EF6F00']
]
}
The crucial piece of this was the addition of the 100% when specifying the gradient in the first place.

Add text to a picture using photoshop

I want to know if exist templates to add text on photoshop like in the following pictures:
http://sphotos-e.ak.fbcdn.net/hphotos-ak-ash4/485070_566956359990277_263279122_n.jpg
https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-ash4/3263_403189956409783_609225582_n.jpg
Could you suggest some pages where I can study and try those effects ?
Thanks.
Step1: Find the fonts. Search on font sites for similiar fonts or try to cut out the font and upload it to http://www.whatfontis.com/ or http://www.myfonts.com/WhatTheFont/
Step2: just play around with blending options and stuff.
from what I can see it's these settings you want too look at:
"Notche Latina": Gradient overlay, white stroke and black dropshadow.
"photo recoblablabla": inner shadow and might be in overlay-mode or something
"Festival de la bira": once again, white stroke
First make a layer adjust the objcet on layer as per your requirement.
Add some effects from filter gallery if you required (or layer style).
Click on the text toolbar type your text (required text).Then to apply effects
right click on text layer and click on rasterize type.now you can add effects from the filter gallery to the text.(or Layer style eg-inner shadows,bevel and emboss).

Chart templates, color schemes and font sizes

I'm trying to automate some PowerPoint charts, but I'm having problems preserving some formatting.
When I add a chart using a chart template, the chart doesn't use the slides color scheme, but rather the colors it was saved with. It doesn't help to change the color scheme for the slide - the chart isn't updated. To make the chart update to the color scheme of the slide, I have to clear formatting for the chart. The problem with doing this is that all font sizes are automatically set to 18pt. I cannot find any easy way restore the font sizes for the chart without saving all sizes before calling clear, and set them back after clearing.
Have you looked into using the Format Painter function it may or may not work depending on a variety of factors from my quick look on the net (google it for lots of articles).
Also if you've done one chart you should be able to copy the formatting from one chart to another using the paste special option as mentioned here http://www.pcreview.co.uk/forums/there-format-painter-equivalent-use-many-charts-t3611646.html .