Set Default Color For BarChart YAxis Data Values.
Remove alert
|
Edit
|
Delete
|
Change type
0
I am new to MS Chart. I am drawing a simple bar chart with following code. My chart draws red lines, for my datapoints (Y Axis), I want to draw, I want to set the color of remaining data points for example for 1st record (i.e. dt1) my jobData
have value 10, my graph shows red line for 10 points, for remaining 20 points I need to show the Green Line and also for the remaining data points. Thanks in advance.
double[] jobData = new double[] { 10, 3, 4, 5, 2, 0, 2, 3, 0, 1 };
DateTime dt1 = new DateTime(2015, 3, 17, 8, 30, 0);
DateTime dt2 = new DateTime(2015, 3, 17, 8, 35, 0);
DateTime dt3 = new DateTime(2015, 3, 17, 8, 40, 0);
DateTime dt4 = new DateTime(2015, 3, 17, 8, 45, 0);
DateTime dt5 = new DateTime(2015, 3, 17, 8, 50, 0);
DateTime dt6 = new DateTime(2015, 3, 17, 8, 55, 0);
DateTime dt7 = new DateTime(2015, 3, 17, 9, 00, 0);
DateTime dt8 = new DateTime(2015, 3, 17, 9, 05, 0);
DateTime dt9 = new DateTime(2015, 3, 17, 9, 10, 0);
DateTime dt10 = new DateTime(2015, 3, 17, 9, 15, 0);
DateTime[] xData = new DateTime[] { dt1, dt2, dt3, dt4, dt5,dt6,dt7,dt8,dt9,dt10 };
InitializeComponent();
//Horizontal bar chart
//Create a chart area and add it to the chart
ChartArea area = new ChartArea("First");
chart1.ChartAreas.Add(area);
// chart1.x = Color.Green;
chart1.Size = new Size(1000, 700);
//Create a series using the data
Series barSeries = new Series();
barSeries.XValueType = ChartValueType.DateTime;
barSeries.BorderColor = Color.Green;
barSeries.ChartType = SeriesChartType.Column;
barSeries.Color = Color.Red;
area.AxisX.LabelStyle.Format = "HH:mm";
area.AxisY.Maximum = 30;
area.AxisY.InterlacedColor = Color.Green;
area.AxisY.Interval = 1;
// chart1.ChartAreas(0).AxisX.LabelStyle.Format = "HH:00"
barSeries.Points.DataBindXY(xData, jobData );
//Set the chart type, Bar; horizontal bars
barSeries.ChartType = SeriesChartType.Bar;
//Assign it to the required area
barSeries.ChartArea = "First";
//Add the series to the chart
chart1.Series.Add(barSeries);
Remove alert
|
Edit
|
Delete
|
Change type
0
I am new to MS Chart. I am drawing a simple bar chart with following code. My chart draws red lines, for my datapoints (Y Axis), I want to draw, I want to set the color of remaining data points for example for 1st record (i.e. dt1) my jobData
have value 10, my graph shows red line for 10 points, for remaining 20 points I need to show the Green Line and also for the remaining data points. Thanks in advance.
double[] jobData = new double[] { 10, 3, 4, 5, 2, 0, 2, 3, 0, 1 };
DateTime dt1 = new DateTime(2015, 3, 17, 8, 30, 0);
DateTime dt2 = new DateTime(2015, 3, 17, 8, 35, 0);
DateTime dt3 = new DateTime(2015, 3, 17, 8, 40, 0);
DateTime dt4 = new DateTime(2015, 3, 17, 8, 45, 0);
DateTime dt5 = new DateTime(2015, 3, 17, 8, 50, 0);
DateTime dt6 = new DateTime(2015, 3, 17, 8, 55, 0);
DateTime dt7 = new DateTime(2015, 3, 17, 9, 00, 0);
DateTime dt8 = new DateTime(2015, 3, 17, 9, 05, 0);
DateTime dt9 = new DateTime(2015, 3, 17, 9, 10, 0);
DateTime dt10 = new DateTime(2015, 3, 17, 9, 15, 0);
DateTime[] xData = new DateTime[] { dt1, dt2, dt3, dt4, dt5,dt6,dt7,dt8,dt9,dt10 };
InitializeComponent();
//Horizontal bar chart
//Create a chart area and add it to the chart
ChartArea area = new ChartArea("First");
chart1.ChartAreas.Add(area);
// chart1.x = Color.Green;
chart1.Size = new Size(1000, 700);
//Create a series using the data
Series barSeries = new Series();
barSeries.XValueType = ChartValueType.DateTime;
barSeries.BorderColor = Color.Green;
barSeries.ChartType = SeriesChartType.Column;
barSeries.Color = Color.Red;
area.AxisX.LabelStyle.Format = "HH:mm";
area.AxisY.Maximum = 30;
area.AxisY.InterlacedColor = Color.Green;
area.AxisY.Interval = 1;
// chart1.ChartAreas(0).AxisX.LabelStyle.Format = "HH:00"
barSeries.Points.DataBindXY(xData, jobData );
//Set the chart type, Bar; horizontal bars
barSeries.ChartType = SeriesChartType.Bar;
//Assign it to the required area
barSeries.ChartArea = "First";
//Add the series to the chart
chart1.Series.Add(barSeries);
Hello,
Since this issue is mainly related to Chart control, I have helped you move this thread to
Chart Controls for .NET Framework forum to get help.
Regards,
Carl
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Similar Messages
-
Set Default Color For BarChart YAxis.
I am new to MS Chart. I am drawing a simple bar chart with following code. My chart draws red lines, for my datapoints (Y Axis), I want to draw, I want to set the color of remaining data points for example for 1st record (i.e. dt1) my jobData
have value 10, my graph shows red line for 10 points, for remaining 20 points I need to show the Green Line and also for the remaining data points. Thanks in advance.
double[] jobData = new double[] { 10, 3, 4, 5, 2, 0, 2, 3, 0, 1 };
DateTime dt1 = new DateTime(2015, 3, 17, 8, 30, 0);
DateTime dt2 = new DateTime(2015, 3, 17, 8, 35, 0);
DateTime dt3 = new DateTime(2015, 3, 17, 8, 40, 0);
DateTime dt4 = new DateTime(2015, 3, 17, 8, 45, 0);
DateTime dt5 = new DateTime(2015, 3, 17, 8, 50, 0);
DateTime dt6 = new DateTime(2015, 3, 17, 8, 55, 0);
DateTime dt7 = new DateTime(2015, 3, 17, 9, 00, 0);
DateTime dt8 = new DateTime(2015, 3, 17, 9, 05, 0);
DateTime dt9 = new DateTime(2015, 3, 17, 9, 10, 0);
DateTime dt10 = new DateTime(2015, 3, 17, 9, 15, 0);
DateTime[] xData = new DateTime[] { dt1, dt2, dt3, dt4, dt5,dt6,dt7,dt8,dt9,dt10 };
InitializeComponent();
//Horizontal bar chart
//Create a chart area and add it to the chart
ChartArea area = new ChartArea("First");
chart1.ChartAreas.Add(area);
// chart1.x = Color.Green;
chart1.Size = new Size(1000, 700);
//Create a series using the data
Series barSeries = new Series();
barSeries.XValueType = ChartValueType.DateTime;
barSeries.BorderColor = Color.Green;
barSeries.ChartType = SeriesChartType.Column;
barSeries.Color = Color.Red;
area.AxisX.LabelStyle.Format = "HH:mm";
area.AxisY.Maximum = 30;
area.AxisY.InterlacedColor = Color.Green;
area.AxisY.Interval = 1;
// chart1.ChartAreas(0).AxisX.LabelStyle.Format = "HH:00"
barSeries.Points.DataBindXY(xData, jobData );
//Set the chart type, Bar; horizontal bars
barSeries.ChartType = SeriesChartType.Bar;
//Assign it to the required area
barSeries.ChartArea = "First";
//Add the series to the chart
chart1.Series.Add(barSeries);I am not sure this is exactly what you mean, but, I think the only way to change the data color is to use a different series.
Imports System.Windows.Forms.DataVisualization.Charting
Public Class Form6
Private Sub Form6_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'setup the chart
With Chart1.ChartAreas(0)
.AxisX.Title = "X"
.AxisX.MajorGrid.LineColor = Color.LightBlue
.AxisX.Minimum = 0
.AxisX.Maximum = 24
.AxisX.Interval = 6
.AxisY.Title = "Y"
.AxisY.MajorGrid.LineColor = Color.LightGray
.AxisY.Minimum = 0
.AxisY.Maximum = 24
.AxisY.Interval = 6
.BackColor = Color.FloralWhite 'AntiqueWhite 'LightSkyBlue
.BackSecondaryColor = Color.White
.BackGradientStyle = GradientStyle.HorizontalCenter
.BorderColor = Color.Blue
.BorderDashStyle = ChartDashStyle.Solid
.BorderWidth = 1
.ShadowOffset = 2
End With
Dim heading1 As String = " 1 - 12"
Dim heading2 As String = "13 - 24"
'draw the chart
Chart1.Series.Clear()
Chart1.Series.Add(heading1)
Chart1.Series.Add(heading2)
Chart1.Series(0).ChartType = DataVisualization.Charting.SeriesChartType.Line
Chart1.Series(0).BorderWidth = 1
Chart1.Series(0).Color = Color.Red
Chart1.Series(0).BorderDashStyle = ChartDashStyle.Dash
Chart1.Series(0).MarkerStyle = DataVisualization.Charting.MarkerStyle.Square
Chart1.Series(0).MarkerSize = 4
Chart1.Series(1).ChartType = DataVisualization.Charting.SeriesChartType.Line
Chart1.Series(1).Color = Color.ForestGreen
Chart1.Series(1).BorderWidth = 2
For x = 1 To 24
If x > 12 Then
Chart1.Series(1).Points.AddXY(x, x)
Else
Chart1.Series(0).Points.AddXY(x, x)
End If
Next
End Sub
End Class -
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 PMHere 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);
} -
Can I set default colors for generated shapes in Premiere Pro CC?
I'm working on some highlight video where I need to generate an ellipse on each clip to highlight a player. I'd like to use a yellow/yellow, 20% softness, 8 thickness ellipse each time, but by default PP gives me an ugly green/blue combination, and I have to change the inside/outside colors, softness and thickness each time I add a clip and generate an ellipse.
Is there a way to set a default inner/outer color, thickness, and softness setting for each new generated shape so that I don't have to keep repeating these steps?If you are using the Title Designer to generate your ellipse, and if I understand what you want, the answer is yes.
Unless I am completely off-base, your default font style below the title has the colors of that ugly green/blue combo.
You can easily just set the ellipse the exact way you want it, and then go into the Font Styles menu and create a new font style. Give it a unique name like "Ellipse" and then drag that new style from the end up to the beginning of the list. (Upper left hand corner).
I created an ellipse using a greenish yellow, rather unattractive color for both the shape and the stroke. I used a higher opacity because it shows up better in the screen shot, but I could have set it for 20% easily enough. I then went to the styles menu, created a new style, gave it a name, then went to the last style and dragged it up to the top left where you see it now. You have to look close.
It is not particularly obvious that the shapes are based on the font style just as much as the text is. -
Setting a default color for messages in Mail
I figured out how to change the default font & font size in messages in the Mail application, and how to change the color in my signature, however I cannot figure out how to set the default color for new messages?
Hi,
Look at the Mail's preferences, under Composing. Select where you like to save notes and todos. -
Is there a way to change the default colors for iPad apps?
I noticed one of my friends iPad 2 had a different color scheme for apps and I would like to change my iPad 2's default ( which is currently grey). To elaborate, the default color for the borders and tabs in Safari are grey on my iPad, my friends are blue. Would like to change from the drab grey color to blue also but I cannot find a setting for this. All applications and Setup apps have this default color scheme on my ipad. Do I have to reset the iPad and start over with setup to achieve this? Hope not, perhaps someone can shed some light on an easy way to do this. Thank You!
You can apply system-wise "negative" color effect under Settings > General > Accessibility, by toggling the White and Black switch - and, in iCab Mobile (and some other, better browsers / PDF readers), its own "night mode" negative color scheme.
Otherwise, no, you can't do anything else except for asking third party app authors to add selectable back/froeground (=text) colors to their apps.
There is an article dedicated to this question: http://www.iphonelife.com/blog/87/do-you-find-your-idevices-screen-be-too-blueis h-or-just-too-harsh-bedtime-reading -
How to set background color for selected days in DateChooser
How to set background color for selected days. I created
checkbox for each day [Son,Mon,Tue,Wed,Thu,Fri,Sat] and a
DateChooser, I want to change the background color for the selected
day when i click on a button after selecting the desired checkboxs
[ monthly wise/yearly wise]
Thanks in advanceThere is no button involved in the following code, but it may
be of use to you:
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script>
<![CDATA[
private var origColor:uint;
private function init():void {
origColor = dc.getStyle("selectionColor");
public function setBackGrdColors(newColor:uint):void {
dc.setStyle("selectionColor", origColor);
if(dc.selectedDate){
var dayOfWeek:Number = dc.selectedDate.day;
else{
return;
switch(dayOfWeek) {
case 0:
if(sun.selected)
dc.setStyle("selectionColor", newColor);
break;
case 1:
if(mon.selected)
dc.setStyle("selectionColor", newColor);
break;
case 2:
if(tue.selected)
dc.setStyle("selectionColor", newColor);
break;
case 3:
if(wed.selected)
dc.setStyle("selectionColor", newColor);
break;
case 4:
if(thu.selected)
dc.setStyle("selectionColor", newColor);
break;
case 5:
if(fri.selected)
dc.setStyle("selectionColor", newColor);
break;
case 6:
if(sat.selected)
dc.setStyle("selectionColor", newColor);
break;
default:
break;
]]>
</mx:Script>
<mx:VBox horizontalAlign="center" verticalGap="20">
<mx:DateChooser id="dc" textAlign="left"
change="setBackGrdColors(cellColor.selectedColor)"/>
<mx:HBox width="100%" horizontalAlign="center">
<mx:CheckBox id="sun" label="Sun"/>
<mx:CheckBox id="mon" label="Mon"/>
<mx:CheckBox id="tue" label="Tue"/>
<mx:CheckBox id="wed" label="Wed"/>
</mx:HBox>
<mx:HBox width="100%" horizontalAlign="center">
<mx:CheckBox id="thu" label="Thu"/>
<mx:CheckBox id="fri" label="Fri"/>
<mx:CheckBox id="sat" label="Sat"/>
</mx:HBox>
<mx:HBox width="300" horizontalAlign="center">
<mx:Label text="Background Color" />
<mx:ColorPicker id="cellColor"
selectedColor="#FF00FF"/>
</mx:HBox>
</mx:VBox>
</mx:Application> -
How to set default color to e-mail
I want to set a default color for all e-mail messages and although I have tried to set the color it doesn't seem to work ... second day with a mac, so speak slowly.
Also want to set up a signature with the name in one color and address and contact info a different color. I went into mail>preferences>signatures and was able to change font on different lines of signature ... but when I tried to apply colors, it didn't work
Thanks very much in advance for your assistance, halboyehalboye wrote:
I want to set a default color for all e-mail messages and although I have tried to set the color it doesn't seem to work ... second day with a mac, so speak slowly.
that's not possible. you'll have to do it for every message individually.
Also want to set up a signature with the name in one color and address and contact info a different color. I went into mail>preferences>signatures and was able to change font on different lines of signature ... but when I tried to apply colors, it didn't work
that's possible. while editing a signature go to Format menu->show fonts. in the popup click on T with a green rectangle next to it. that's the button for font color. you'll get yet another popup for color. highlight some text in the signature and click on the color you want.
Thanks very much in advance for your assistance, halboye -
Changing default color for arrows from the Shapes palette.
I'm building a tutorial website for how to buy kitchens from my cabinetshop.
I use a lot of arrow type lines from the Shapes Palette.
After I create the arrow-line I have to re-color it to red with the Graphics Inspector.
Is there a way to set red as the default color for this object?No. Send a feature request to Apple via http://www.apple.com/feedback/iweb.html.
OT -
Set Background color for headers in excel
DECLARE
v_fh UTL_FILE.file_type;
v_dir VARCHAR2 (30) := 'my dir';
v_file VARCHAR2 (30) := 'test.xls';
PROCEDURE run_query (p_sql IN VARCHAR2)
IS
v_v_val VARCHAR2 (4000);
v_n_val NUMBER;
v_d_val DATE;
v_ret NUMBER;
c NUMBER;
d NUMBER;
col_cnt INTEGER;
f BOOLEAN;
rec_tab DBMS_SQL.desc_tab;
col_num NUMBER;
BEGIN
c := DBMS_SQL.open_cursor;
-- parse the SQL statement
DBMS_SQL.parse (c, p_sql, DBMS_SQL.native);
-- start execution of the SQL statement
d := DBMS_SQL.EXECUTE (c);
-- get a description of the returned columns
DBMS_SQL.describe_columns (c, col_cnt, rec_tab);
-- bind variables to columns
FOR j IN 1 .. col_cnt
LOOP
CASE rec_tab (j).col_type
WHEN 1
THEN
DBMS_SQL.define_column (c, j, v_v_val, 4000);
WHEN 2
THEN
DBMS_SQL.define_column (c, j, v_n_val);
WHEN 12
THEN
DBMS_SQL.define_column (c, j, v_d_val);
ELSE
DBMS_SQL.define_column (c, j, v_v_val, 4000);
END CASE;
END LOOP;
-- Output the column headers
UTL_FILE.put_line (v_fh, '<ss:Row>');
FOR j IN 1 .. col_cnt
LOOP
UTL_FILE.put_line (v_fh, '<ss:Cell>');
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="String">'
|| rec_tab (j).col_name
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
END LOOP;
UTL_FILE.put_line (v_fh, '</ss:Row>');
-- Output the data
LOOP
v_ret := DBMS_SQL.fetch_rows (c);
EXIT WHEN v_ret = 0;
UTL_FILE.put_line (v_fh, '<ss:Row>');
FOR j IN 1 .. col_cnt
LOOP
CASE rec_tab (j).col_type
WHEN 1
THEN
DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
UTL_FILE.put_line (v_fh, '<ss:Cell>');
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="String">'
|| v_v_val
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
WHEN 2
THEN
DBMS_SQL.COLUMN_VALUE (c, j, v_n_val);
UTL_FILE.put_line (v_fh, '<ss:Cell>');
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="Number">'
|| TO_CHAR (v_n_val)
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
WHEN 12
THEN
DBMS_SQL.COLUMN_VALUE (c, j, v_d_val);
UTL_FILE.put_line (v_fh,
'<ss:Cell ss:StyleID="OracleDate">'
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="DateTime">'
|| TO_CHAR (v_d_val,
'YYYY-MM-DD"T"HH24:MI:SS'
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
ELSE
DBMS_SQL.COLUMN_VALUE (c, j, v_v_val);
UTL_FILE.put_line (v_fh, '<ss:Cell>');
UTL_FILE.put_line (v_fh,
'<ss:Data ss:Type="String">'
|| v_v_val
|| '</ss:Data>'
UTL_FILE.put_line (v_fh, '</ss:Cell>');
END CASE;
END LOOP;
UTL_FILE.put_line (v_fh, '</ss:Row>');
END LOOP;
DBMS_SQL.close_cursor (c);
END;
PROCEDURE start_workbook
IS
BEGIN
UTL_FILE.put_line (v_fh, '<?xml version="1.0"?>');
UTL_FILE.put_line
(v_fh,
'<ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">'
END;
PROCEDURE end_workbook
IS
BEGIN
UTL_FILE.put_line (v_fh, '</ss:Workbook>');
END;
PROCEDURE start_worksheet (p_sheetname IN VARCHAR2)
IS
BEGIN
UTL_FILE.put_line (v_fh,
'<ss:Worksheet ss:Name="' || p_sheetname || '">'
UTL_FILE.put_line (v_fh, '<ss:Table>');
END;
PROCEDURE end_worksheet
IS
BEGIN
UTL_FILE.put_line (v_fh, '</ss:Table>');
UTL_FILE.put_line (v_fh, '</ss:Worksheet>');
END;
PROCEDURE set_date_style
IS
BEGIN
UTL_FILE.put_line (v_fh, '<ss:Styles>');
UTL_FILE.put_line (v_fh, '<ss:Style ss:ID="OracleDate">');
UTL_FILE.put_line
(v_fh,
'<ss:NumberFormat ss:Format="dd/mm/yyyy\ hh:mm:ss"/>'
UTL_FILE.put_line (v_fh, '</ss:Style>');
UTL_FILE.put_line (v_fh, '</ss:Styles>');
END;
BEGIN
v_fh := UTL_FILE.fopen (v_dir, v_file, 'w', 32767);
start_workbook;
set_date_style;
start_worksheet ('OM');
run_query ('select PARTY_ID,PARTY_NAME from HZ_PARTIES
where PARTY_ID<1080');
end_worksheet;
start_worksheet ('PO');
run_query ('SELECT AGENT_ID,TYPE_LOOKUP_CODE FROM PO_HEADERS_ALL
WHERE PO_HEADER_ID<20');
end_worksheet;
end_workbook;
UTL_FILE.fclose (v_fh);
END;
Here i will get two outputs in same excel with different spread sheets,
now i want to set background color for headers i
ex:PARTY_ID,PARTY_NAME,AGENT_ID,TYPE_LOOKUP_CODE are the headers,in excel output i want background color as blue.
Please do need full help,its urgent req.Hello,
open the file in Excel and save it, just to ensure that Excel writes all the additional stuff it thinks is necessary.
Now change the background colour of the header and save the file again but with a different name.
Open both files in a text editor and look at the differences. That's what you need to change in your code.
Alternatively you can use packages like xml_spreadsheet or ExcelDocumentType, both write the same file format that you use in your code and you don't have to reinvent the wheel.
Regards
Marcus -
Create class in custom.css to define one's own default colors for charts
Hi All,
I need to create a set of default colors for bar charts instead of the default ones. I dont want to change the colors in palette.xml file because there are other charts depending on the default colors. Is there a way I can create a new class that I can define in the Custom CSS class section. I am working on obiee 10g
Thanks,
KavyaTo force automatic wrapping as a function of the coordinate x (as opposed to a ctrl-enter), I modified the WrapApp( ) as follows: i) added a keyListener to the JTextPane component:
edit.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
editKeyPressed(evt);
});and, added the following listener:
private void editKeyPressed(KeyEvent evt) {
try {
int dot = edit.getCaret().getDot();
Rectangle cc = edit.modelToView(dot);
System.out.println("CTP: " + dot + ", (x, y): (" + cc.x + ", " + cc.y + ")");
if (evt.getKeyCode() == 8) {
return;
if (cc.x > 100) {
insertLineBreak(); // as shown in the reference provided earlier
} catch (BadLocationException ex) {
}The behavior is fine as it automatically wraps and it outputs:
CTP: 0, (x, y): (3, 3)
CTP: 1, (x, y): (10, 3)
CTP: 2, (x, y): (17, 3)...
However, if I add change the component orientation edit.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT), the x-coordinate is shot to its positive limit and all printed characters are no longer visible! The output now is:
CTP: 0, (x, y): (32770, 3)
CTP: 2, (x, y): (32763, 3)
CTP: 4, (x, y): (32756, 3)...
Any idea how to fix that the x-coordinate is within limits (e.g., it should be bounded by the size of the editor pane)?
Thank you.
-mmm -
A quick way to set different color for certain items in JList?
is there a quick way of setting different color for certain items in JList?
Either use HTML strings as the values in your JList (quickest, but may not be the most convenient, especially if your model isn't just text), or create your own ListCellRenderer (e.g. extend DefaultListCellRenderer).
There is no such thing as "list.setItemForeground(int index, Color c)". You'll have to use one of the methods above. -
Set different color for one JTree node
hello,
I managed to find how to set a color for Jtree nodes but the problem is that with my method all the nodes will b the same color whereas i'm looking to have nodes of different color depending on the situation.
the method for setting all Jtree nodes the same color(other than black):
tree.setCellRenderer(
new DefaultTreeCellRenderer() {
public Color getTextNonSelectionColor() {
return Color.lightGray; } });I WANT TO CHOSSE EACH COLOR FOR EACH NODE
help plz
thanksYou need to implement TreeCellRenderer interface
public Component getTreeCellRendererComponent(JTree tree,
Object value,
boolean sel,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)You can know which node is rendering by check value argument. Please read DefaultTreeCellRenderer's code. -
Setting Default Preferences for All Users in Crystal Reports Server 2008 v1
We are currently looking to set the default preferences in the CMC for all of our users.
I did locate this page Link: [How to set default preferences for all users in Infoview 3.1/CRS 2008]
The first part of the thread did seem promising but I am unable to find the sample .jsp code that people recommended.
I would assume that this scenario is common enough that someone knows a way to set universal preference defaults.
Thank youI thought I could just run it too but when I attempt to I get a Windows Script Host error:
Script: C:\User Prefs.vbs
Line: 1
Char: 1
Error: Expected statement
Code: 800A0400
Source: Microsoft VBScript compilation error.
I noticed the first most line seems to be markup for a web interface though I am not familiar with vbs so I may be wrong. I used the publishing wizard to put the script on the CMC to attempt to run it through the CMC but it still does not work. -
How to set default language for Portal?
Hi All,
We use EP6.
Default language is not defined and therefore is being set by the browser's language.
Where do I set default language for all users?
(I don't want that the users will be able to change it by themselves by browser/EU role).
I tried to set the "request.mandatorylanguage" and
"request.mandatorycountry" in prtDefault.properties but it didn't help.
Thanks,
OmriHi Omri,
are those to parameters
request.defaultlanguage=...
request.defaultcountry=...
set in the prtDefault.properties, and the J2EE Server restarted after the change?
Check out this thread and the link given there for more info: HOW to define the default language in the portal
Hope this helps,
Robert
Maybe you are looking for
-
JDBC - how to call Stored Procedure
Hi! My problem is that I can't call a procedure created at my DB through JDBD. I have a similar stored function working fine (code-> String query = "begin :1 := funcStored; end;"; CallableStatement cstmt = connection.prepareCall(query); cstmt.registe
-
I just installed PSE 11 and my raw files won't open. They opened in 10 but not with 11?
I just installed PSE 11 and there is no camera raw. PSE 10 worked fine. Any help?
-
Hey All, I hope this is the correct forum. I just started working with Flex in addition to my other duties. The learning curve has been pretty steep for me so far. I need to speed things along and I'm willing to compensate someone for their time. You
-
IPhone 4s is locked activation locked after resetting it.
I recently bought a iPhone 4s for my dad off of someone from a Facebook buy,sell,and trade group. I got it home and reset the phone so it was like brand new. I went to re-activate it and it is requiring the email & password that was used to activate
-
I don't know what I did, but after I made my last updates and published I found I can't open any of the other page. That is when I go to the site itself.