Change color in chart series (Chart Controls)?

Does anyone know if it's possible to change the color within a series in Microsoft Chart Controls?  My data is X = test time and Y = response time using a column graph.  Currently when the test to collect response time fails it does not
record a numerical value and when graphed it appears as though the response time was minimal.  I want to make it stand out when a failure occurs, for example to draw a large column and change the color to red (other values are in blue).
I don't have much experience using Chart Controls yet.  I know you can use an alternate color with a different series of data but it doesn't appear you can change it from within. 
This is my chart series (when a test fails, the response matches "" and not $NULL):
[void]$chart1.Series.Add("ResponseTime")
$chart1.Series["ResponseTime"].ChartType = "Line"
$chart1.Series["ResponseTime"].BorderWidth  = 1
$chart1.Series["ResponseTime"].IsVisibleInLegend = $true
$chart1.Series["ResponseTime"].chartarea = "ChartArea1"
$chart1.Series["ResponseTime"].color = "#0404B4"
$DATA | ForEach-Object {
If ($_.RESPONSE_MS -eq "") {
$chart1.Series["ResponseTime"].Points.addxy("FAIL",9999)
Else {
$chart1.Series["ResponseTime"].Points.addxy( $_.TIME.Remove(5) , ($_.RESPONSE_MS)) }
I tried changing the color within the if/else but the first .color value it picks up will be used throughout. 

Hi Tickermcse76,
To create a new line chart, please refer to this script:
function New-Chart
param ([int]$width,[int]$height,[int]$left,[int]$top,$chartTitle)
# create chart object
$global:Chart = New-object System.Windows.Forms.DataVisualization.Charting.Chart
$global:Chart.Width = $width
$global:Chart.Height = $height
$global:Chart.Left = $left
$global:Chart.Top = $top
# create a chartarea to draw on and add to chart
$chartArea = New-Object System.Windows.Forms.DataVisualization.Charting.ChartArea
$global:chart.ChartAreas.Add($chartArea)
[void]$global:Chart.Titles.Add($chartTitle)
# change chart area colour
$global:Chart.BackColor = [System.Drawing.Color]::Transparent
} #New-Chart
New-Chart -width $width -height $height -left $left -top $top -chartTile $chartTitle
[void]$global:Chart.Series.Add("Data")
# $global:Chart.Series["Data"].Points.AddXY($(get-date), $($ht.Values))
$global:Chart.Series["Data"].Points.DataBindXY($ht.Keys,$ht.Values)
#$global:Chart.Series["Data"].XValueType = [System.Windows.Forms.DataVisualization.Charting.ChartValueType]::Time
#$global:Chart.chartAreas[0].AxisX.LabelStyle.Format = "hh:mm:ss"
#$global:Chart.chartAreas[0].AxisX.LabelStyle.Interval = 1
#$global:Chart.chartAreas[0].AxisX.LabelStyle.IntervalType = [System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType]::Seconds
$global:Chart.Series["Data"].ChartType = [System.Windows.Forms.DataVisualization.Charting.SeriesChartType]::Line
#$global:chart.Series["Data"].IsValueShownAsLabel = $false
Reference from:
http://poshcode.org/1205
To change the chart color, please refer to this script:
Charting with PowerShell
I hope this helps.

Similar Messages

  • Change color palette of combination chart

    Hello everyone,
    I am experiencing a problem when trying to change to color palette of a combination chart.
    According to the api there should be a method setColorPalette(aColorPalette) and a property colorPalette;
    (JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.viz.ui5.types.Combination)
    when I try to call this method I receive the following error:
    TypeError: Object [object Object] has no method 'setColorPalette'
    I introduced the combination chart before by calling jQuery.sap.require("sap.viz.ui5.types.Combination"); outside of the controller;
    I also tried to add the porperty colorPalette in xml, but it seems to be ignored.
    Has anyone an idea on what the reason could be?
    Best regards,
    Benedikt

    Hi Benedikt,
    you can find below working code of changing color palette of chart.
    This is based on pie chart but accordingly you can use for combination chart.
    JS Bin - Collaborative JavaScript Debugging</title> <link rel="icon" href="http://static.jsbin.…
    Regards,
    Chandra

  • Conditionally Changing Colors of Bars in Chart Using BI Templatet Builder.

    How to change color of bars in Bar Chart using BI Publihser Template Builder?
    Ex : We have conditions such as When Revenue is between 2000 to 4000 Color of Bar should be red, If Revenue is Higher then 4000 then color of Bars should be Green.
    Please reply!!

    Go to insert menu and choose condetional foram ans set appropreate settings in your template bilder.
    Venkat v

  • Change colors in multiple pie chart - with legend

    I need to change the colors of groups shown in multiple pie chart diagram in CR XI.
    I managed to actually change the colors in the diagram by using highlighting rules in the wizard. (Sorry, I need to guess the correct English terms since I am using the German version.)
    But the colors in the legend are not affected by the rules, so the legend displays colors which are not shown in the diagrams at all. How can I fix this?
    Thanks in Advance
       Andreas

    Hi Andreas
    I have the same problem.
    I found this BO note:
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3131383434373026
    I says that this behaviour is by design and cannot change
    Not what you would expect really! 
    If the series colour can be changed then why does the series marker colour not match the series it represents?
    Patrick

  • How to programmatically change color of arc in cwknob

    trying to change color of arc in cwknob control conditonally

    I'm not entirely sure what part of the control you are referring to by "arc". Can you elaborate?
    If you mean the (by default) black line that the pointer points to when you choose a meter style and to which the major and minor ticks are connected, you can change its color with the following code:
    CWKnob1.Axis.Ticks.MajorTickColor = vbYellow
    If you looked for and didn't find the property you need, I suggest you check out the properties of the Axis subobject of the knob. People frequently overlook this important subobject of the knob and slide.
    In general, if you are able to configure a property on any property page except the Advanced property page, you should be able to configure it programmatically.
    If my suggestions above don't get the job done
    for you, you could take screen capture of the control, drop it in Paint, circle the portion of the control you want to configure, and attach it to a response to this post.

  • Changing chart series colors with colorpicker

    I am trying to implement functionality to allow the user to
    select what color he wants a particular series item in a chart to
    be. Here's what I'm doing, but it doesn't work. I get the series
    object returned correctly, but "setStyle" doesn't do anything.

    Alright, I think I have something you're looking for. This
    updates the series' color in the legend, too.
    <?xml version="1.0"?>
    <!-- charts/BasicLine.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script><![CDATA[
    import mx.collections.ArrayCollection;
    import mx.charts.events.ChartItemEvent;
    import mx.controls.ColorPicker;
    import mx.events.ColorPickerEvent;
    import mx.charts.HitData;
    import mx.charts.chartClasses.ChartElement;
    import mx.graphics.Stroke;
    import mx.charts.series.items.LineSeriesItem;
    [Bindable]
    public var expenses:ArrayCollection = new ArrayCollection([
    {Month:"Jan", Profit:2000, Expenses:1500, Amount:450},
    {Month:"Feb", Profit:1000, Expenses:200, Amount:600},
    {Month:"Mar", Profit:1500, Expenses:500, Amount:300}
    private var cp:ColorPicker;
    private var csi:LineSeriesItem;
    private var el:ChartElement;
    private function doSomething(e:ChartItemEvent):void {
    var hitData:HitData = e.hitData;
    csi = LineSeriesItem(hitData.chartItem);
    el = ChartElement(csi.element);
    cp = new ColorPicker();
    myChart.addChild(cp);
    cp.addEventListener(ColorPickerEvent.CHANGE,
    changeItemColor);
    cp.x = e.localX;
    cp.y = e.localY;
    cp.open();
    private function changeItemColor(e:ColorPickerEvent):void {
    var s1:Stroke = new Stroke(cp.selectedColor, 4, 1); //First
    3 arguments are color, weight, and alpha.
    el.setStyle("lineStroke", s1);
    // Use this if it's a column or bar series:
    // var c:SolidColor = new SolidColor(cp.selectedColor);
    //el.setStyle("fill", c);
    //csi.itemRenderer.height = csi.itemRenderer.height;
    myChart.removeChild(cp);
    ]]></mx:Script>
    <mx:Panel title="Line Chart">
    <mx:LineChart id="myChart"
    dataProvider="{expenses}"
    showDataTips="true"
    itemClick="doSomething(event)"
    >
    <mx:horizontalAxis>
    <mx:CategoryAxis
    dataProvider="{expenses}"
    categoryField="Month"
    />
    </mx:horizontalAxis>
    <mx:series>
    <mx:LineSeries
    yField="Profit"
    displayName="Profit"
    selectable="true"
    />
    <mx:LineSeries
    yField="Expenses"
    displayName="Expenses"
    selectable="true"
    />
    </mx:series>
    </mx:LineChart>
    <mx:Legend dataProvider="{myChart}"/>
    </mx:Panel>
    </mx:Application>
    matt horn
    flex docs

  • Change color of series in Charts to custom colors - error in macro generated by Excel

    The case:
    Excel 2013, Multiple cheets with multiple charts of different type. Several charts doesn't show well will the defaut color automatically generated by Excel. -> The idea is to modify these graphics only with a specific color combination (modifying the
    color of the series)
    I'm able to modify the color of each series of 1 chart using the UI. but there are many charts so doing them with a simple macro would speed these repeative steps.
    I turned on the macro recording to capture the change of the color of a selected serie in a selected chart.
    The generated code is:
        ActiveChart.Legend.LegendEntries(1).Select
        With Selection.Format.Fill
            .Visible = msoTrue
            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
            .ForeColor.TintAndShade = 0
            .ForeColor.Brightness = -0.25
            .Transparency = 0.3000000119
            .Solid
        End With
    When I execute the macro, Excel trigger an error:
    Execution error -2147467259 (80004005)
    method "Fill" of object "ChartFormat" has failed   (this is a translated error message, as I run a french version)
    Any idea why Excel cannot run its own generated code ?
    Thanks in advance.

    Very surprisingly the following code (also generated by the macro recording) works ok.
    (I selected the serie inside the chart instead of selecting the serie in the legend)
        ActiveChart.FullSeriesCollection(1).Select
        With Selection.Format.Fill
            .Visible = msoTrue
            .ForeColor.ObjectThemeColor = msoThemeColorAccent3
            .ForeColor.TintAndShade = 0
            .ForeColor.Brightness = -0.25
            .Transparency = 0.3000000119
            .Solid
        End With
    If an MVP or Microsoft official come accross this, I suggest further testing as it is very likely a bug (with the first set of code generated by Excel)

  • How to change the color (or fill) of a SINGLE bar in a bar chart series

    I've searched the forum and consulted the help system in Keynote '09, and I can't find the answer.
    I have a simple bar chart with 6 bars. I want to select two of the bars and turn them a different color. I only seem to be able to change the color of the series as a whole. I can only select the series as a whole, and I can't Ungroup it or even copy it to the clipboard (it beeps!). I've tried changing the color of the number represented by the bar in the underlying table; can't be done.
    Am I attempting something impossible? If so (grumble grumble), why hasn't Apple made it possible? It seems like an obvious thing to allow.

    It is unfortunately impossible -- the individual bars are not selectable. As a workaround you can a) overlay them with a rectangular object, or b) overlay them with a second chart identical to the first, with all the bars except the two set to zero.

  • Single Chart Series with multiple color data points

    I am developing an application using the flex chart component
    and I am binding data to 3 different chart series which is pretty
    intense processing. I was wondering can I use only one chart series
    and when I bind the data points just to change the color per data
    point which meet certain criteria?
    Here one method from my application where I am dynamically
    binding data to my series.
    private function loadSeries(data:XMLList, yAxis:String):void
    seriesAdd.yField = yAxis;
    seriesAdd.xField = "Date";
    //seriesDelete.yField = yAxis;
    //seriesDelete.xField = "Date";
    //seriesChange.yField = yAxis;
    //seriesChange.xField = "Date";
    seriesAdd.dataProvider = data.Trade.(A == 'Add');
    seriesAdd.//Can I change the color per each data point if I
    have multiple data sets?
    //seriesDelete.dataProvider = data.Trade.(A == 'Delete');
    //seriesChange.dataProvider = data.Trade.(A == 'Change');
    Thank you

    I think I found something to get me started:
    http://livedocs.adobe.com/flex/3/html/help.html?content=charts_displayingdata_09.html
    My next question is if I have the following function to fill
    my data points:\
    private function myFillFunction(element:ChartItem,
    index:Number):IFill {
    var c:SolidColor = new SolidColor(0x00CC00);
    var item:ColumnSeriesItem = ColumnSeriesItem(element);
    var sales:Number = Number(item.yValue);
    if (sales >= 50000) {
    return c;
    } else {
    // They have not met their goal.
    c.color = 0xFF0000;
    return c;
    How can I access values that pertain to the specific chart
    item, but are not plotted on the x and y axis. Something similar to
    the checking on the above function, but check if value that is not
    plotted but still exists on the data provider.
    Thanks in advance.

  • Fine-grained control of colors in a bar chart

    Hello,
    Short version: How do I control the colors of the bars in a bar chart in Keynote, so that each bar, representing a particular entity, retains its color no matter its position relative to the other bars after updating the chart?
    Detailed version: I am using iWork '09. In Keynote I have a 3D bar chart showing an indicator for different companies (industry comparison). The companies are sorted in ascending order by revenue, so that the lowest bar (company with smallest revenue) is to the far left and the tallest - to the far right. I update the chart regularly. I have the following problem: each bar, representing a company, is in a particular color. When I update the chart, if the the order of the companies changes, the colors of the bars do not change, so that in the new chart the order of the colors is the same, although some or all of the bars now represent different companies. In other words: if in version 1 company A is in red and comes before company B which is in blue, if in the next version company A comes after company B, I want its bar to still be red. In the current situation, if company A comes after company B its bar will be blue and comapny B's will be red, i.e. red still comes before blue.

    I have to give up the beautiful colors of the automatic chart and only use the restricted number of colors from the color well.
    There is no restricion in the choice of colour, the colour depth on a Mac has over 16 million to choose from.
    Further, the fill type has options for;  colour, gradient, image and tint

  • How do I set default colors for XY chart series (lines and legend)

    I am implementing a line chart and need to override the default (caspian style) colors for the line colors and the legend symbols. I'm not displaying the chart symbols themselves as that would make the chart look bad. I've been able to successfully set the default colors for the lines via the CSS below, but cannot find a way to do the same for the series symbols that appear in the chart legend. How do I do this? Thanks.
    .default-color0.chart-series-line {
      -fx-stroke: rgb(0, 102, 255);
    .default-color1.chart-series-line {
      -fx-stroke: rgb(0, 255, 102);
    ...Update:
    Figured it out. Need to do the following:
    .default-color0.chart-line-symbol {
      -fx-background-color: rgb(R, G, B);
    }Edited by: 998038 on May 16, 2013 4:09 PM

    Here is some css to customize the line and legend colors in a line chart.
    /** file: chart.css
        place in same directory as LineChartWithCustomColors.java */
    .default-color0.chart-series-line {
      -fx-stroke: rgb(0, 102, 255);
    .default-color1.chart-series-line {
      -fx-stroke: rgb(0, 255, 102);
    .default-color0.chart-line-symbol {
      -fx-background-color: rgb(0, 102, 255), white;
    .default-color1.chart-line-symbol {
      -fx-background-color: rgb(0, 255, 102), white;
    }And a test harness to try it:
    import javafx.application.Application;
    import javafx.event.*;
    import javafx.scene.Scene;
    import javafx.scene.chart.*;
    import javafx.scene.control.*;
    import javafx.scene.input.*;
    import javafx.stage.Stage;
    public class LineChartWithCustomColors extends Application {
        @Override public void start(final Stage stage) {
            stage.setTitle("Line Chart Sample");
            //defining the axes
            final NumberAxis xAxis = new NumberAxis();
            xAxis.setLabel("Number of Month");
            final NumberAxis yAxis = new NumberAxis();
            //creating the chart
            final LineChart<Number,Number> lineChart =
                    new LineChart<>(xAxis,yAxis);
            lineChart.setTitle("Stock Monitoring, 2010");
            lineChart.setCreateSymbols(false);
            //defining a series
            XYChart.Series series = new XYChart.Series();
            series.setName("My portfolio");
            //populating the series with data
            series.getData().setAll(
              new XYChart.Data(1, 23),
              new XYChart.Data(2, 14),
              new XYChart.Data(3, 15),
              new XYChart.Data(4, 24),
              new XYChart.Data(5, 34),
              new XYChart.Data(6, 36),
              new XYChart.Data(7, 22),
              new XYChart.Data(8, 45),
              new XYChart.Data(9, 43),
              new XYChart.Data(10, 17),
              new XYChart.Data(11, 29),
              new XYChart.Data(12, 25)
            lineChart.getData().add(series);
            //adding a context menu item to the chart
            final MenuItem resizeItem = new MenuItem("Resize");
            resizeItem.setOnAction(new EventHandler<ActionEvent>() {
              @Override public void handle(ActionEvent event) {
                System.out.println("Resize requested");
            final ContextMenu menu = new ContextMenu(
              resizeItem
            lineChart.setOnMouseClicked(new EventHandler<MouseEvent>() {
              @Override public void handle(MouseEvent event) {
                if (MouseButton.SECONDARY.equals(event.getButton())) {
                  menu.show(stage, event.getScreenX(), event.getScreenY());
            Scene scene =
              new Scene(
                lineChart,800,600
            stage.setScene(
              scene
            stage.show();
            scene.getStylesheets().add(
              getClass().getResource("chart.css").toExternalForm()
        public static void main(String[] args) {
            launch(args);
    }

  • Chart series color

    Hi
    I have a simple bar chart and I want all of it's bars to have the same color.
    Is that possible?
    Any ideas on how to achieve that?
    Regards
    Shlomi

    Hi Shlomi,
    Yes, it is possible.
    Design Studio 1.3:
    Option 1 (typical use case: if your dimension doesn't have too much different values and it has the same values - no new values are added dynamically, for example you have applied a background filter to max. 20 fixed dimension values): Chart > Additional Properties > Data Series: here you can define a different color for each dimension value; you would define the same color for each dimension value
    Option 2 (typical use case: if your dimension has a lot of values which are not fixed in your chart - they change if new data gets loaded or different filters are applied to the data source): Chart > Properties > Display > Conditional Formatting > New Rule...: create a rule where either your measure or dimension meets a condition and choose the color that should be used if the condition is true
    Or use CSS in your custom CSS file (should also work in DS 1.2, but I tested it only in DS 1.3):
    for example:
    /* Chart Type: Bar ; change color for bars */
    .v-m-plot .v-bar rect {fill: orange; stroke: white/*brown*/;}
    /* Chart Type: Bar ; change color for dimension values in legend */
    .v-legend-content path {fill: orange;}
    ...you can further customize the css with other styling too.
    Best Regards,
    David

  • How to set the (specific) color for a Chart Series in a Flash Diagramm

    Hello all,
    I wonder how I can set the color (of a bar) for a Chart Series in a Flash Diagramm.
    So far I found now set-screw for this.
    Can someone give me a hint please.
    Thanks in advance.
    Andre

    Hi,
    On the Chart Attributes page for the region, change the "Color Scheme" setting to Custom. Then, in the "Custom Colors" setting, enter the colours you want for all series, separated by a comma. For example:
    red,yellow,greenAndy

  • Showing Multiple Colors in a single Line series Chart

    Hi there,
    I need to show some High,Low and Normal datapoints with different colors on a single series chart
    I have to use line series.
    Can anyone help me with this, I not even sure if this is possible
    Please throw some light
    Thank you

    For the first variant.
    You have a LineSeries for all data.
    You manually divide your dataProvider for three providers: with low, hi and norm values. And Create additional PlotSeries for each part and set coloror what you want. So line will be shown by LineSeries and point will be shown and colored by PlotSerieses. Very simple variant but if you need to change the low and hi limits It's not so good. But if this limits are static and data is static it's very good.
    If data and limits are dinamic or you want to create more correct solution. It's not so difficult to create itemRenderer for LineSeries (there is a style property itemRenderer). Read about renderers in docs^ http://www.adobe.com/devnet/flex/quickstart/using_item_renderers/

  • Need to change colors of lines in an Omniportlet Line Chart

    I am running Oracle Portal on a 10g Web server. I have created an Omniportlet and I am displaying data in a line chart. Is it possible for me to define the colours of the lines in the linechart?

    Hi I didn't changed colors in line chart but I managed to redesign lot of omniportlets.
    What you can do is to re-define CSS.
    Add an HTML portlet in your page with some CSS embedded.
    To catch wich class are to be re defined, I recommand you to use firefox with the extension Webdevelopper.
    Use the "Informations - display element information" functionnality to catch wich class are used for your chart.
    Then redefine those classes in your custom CSS.
    Hope that will help

Maybe you are looking for

  • Sales order creation in project based industry

    Dear Gurus My client is into erection of cement plants and alcohol plants. once client got the order form the customer for the plant setup production will start. delivery and billing will be created when ever one material is ready after the productio

  • Automatic reset of Quick Poll

    Hi you all! We are going to implement the Quick Poll iView in our local Portal as a tool to decide where to go for lunch. I know, not the most exciting use for it, but it will come in handy for us since we are located in different part of our town. A

  • Setting line color of JTree's

    Hi, I want to set the color of JTree's linestyle which areranch lines. what should i set to get the desired result. i set the linestyle by tree.putClientProperty("JTree.lineStyle", "Angled"); How can i set the linecolor? Thnaks, Sato

  • How to Use Item - Price (ITM1) with SDK ?

    Hi All, I have issued, Please help me. I want to create Item like this: Item (OITM): Item no: 1001 Item Detail (ITM1): Item no : 1001 Item Type : S Price : $200 Item no : 1001 Item Type : T Price : $220 Item no : 1001 Item Type : R Price : $400 Can I

  • ''RAGE'' startup problem

    HI. I have just brougt RAGE over Steam and downloaded it and then i tried to start the game After few intro commercials i've got this long long long error message: Rage.1683.2 win-x86 Release Oct 7 2011 12:22:19 ------ Initializing File System ------