BIRT: Gradient Across Chart instead of Bars - gradient

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.

Related

How to outline border of the slicer in Power BI Desktop

How can I outline the border of the slicer?
I want to change color of the border of the window where it says "All".
I do not need like this:
I need something like that"
Anyway to achieve that in Power bi?
I don't think this is currently possible with the built-in slicer.
To do this, you'll either have to create your own custom visual or else submit an idea and hope it gets implemented.
This image shows the different pieces you can currently adjust.
Notice that the border for the header and the items (purple) is the same thickness and color, the outside border (yellow) can't be changed in width, and the Items Outline doesn't display except on the drop-down section.
You could make a really thick border using the Background, but I don't think that's a good option.

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.

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 .

Fill gradient color in area under line chart in Protovis 3.2

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.

gradients using only html and css and javascript?

Is there a way to do gradients in css/html/javascript only that will work across all the major browsers? (MS IE 5+, Firefox, Opera, Safari)?
Edit: I would like to do this for backgrounds (header, main panel, side panels). Also, would like to have vertical line gradients as well.
Edit: after reading the responses, let's open this up to Javascript solutions as well, since HTML/CSS by itself makes it tougher to achieve.
I've done this before as a gimmick, using javascript like:
var parent = document.getElementByID('foo');
for(var i=0; i< count; i++) {
var div = document.createElement('div');
div.style.position = 'absolute';
div.style.width='100%';
div.style.height = 1/count+"%";
div.style.top = i/count+"%";
div.style.zIndex = -1;
parent.appendChild(div);
}
If your requirement is just to have a gradient, you really should use a gradient image set as background-image in css. In my case, I was animating the colors and position of the gradient as well. I can't vouch for now cross-browser it is (for starters, make sure the parent has some position applied, otherwise it won't be a position-container for the absolute positioning.
I'm unclear on the implementation details you are seeking (such as background, or just a border along the side of the window, etc); however, it's possible albeit a little tedious.
One example that comes to mind would be to have n-block level elements, such as divs, and then give them each a small height (a couple of pixels, for example) and then gradually change the background color of each subsequent element.
I use the gradient CSS code generator by colorzilla: http://www.colorzilla.com/gradient-editor/
It has polyfills for IE - but not sure how far back it goes.
I think the short answer is no.
You can create something that looks like a gradient using only css, but to then use it like an image background... I think that is pushing it a bit.
EDIT (feeling silly)
I found the solution: http://en.wikipedia.org/wiki/JPEG
There are lots of ways to create a gradient now.
1. You can create image for it.
2. Use CSS3 Gradient, it can be linear, radial and repeating.
Syntax for linear :
linear-gradient: ([angle | to ] ,[ [color-stop], [color-stop]+);
Syntax for radial :
linear-gradient: ([angle | to ] ,[ [color-stop], [color-stop]+);
For IE6 to IE 9 we can use the filter property or you can also use CSS3Pie.
Following are some referances that will help:
Mozilla MDN
CSS3File