Visual Studio 2010 Chart control - line color - asp.net

How do I change the color of the horizonal and vertical lines? I'd like to make them a little lighter, yet leave the X and Y axis black, probably.
Edited:
indyfromoz suggestion resulted in this:
The effect I want is this:
(Subtler horiz and vertical lines, maybe even no vertical lines.)

VB
Chart1.ChartAreas(0).AxisY.MajorGrid.LineColor = Color.FromArgb(&H50, &H9C, &H9A, &H95)
Chart1.ChartAreas(0).AxisX.MajorGrid.LineColor = Color.FromArgb(&H50, &H9C, &H9A, &H95)
C#
Chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = Color.FromArgb(50, 200, 200, 200);
Chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.FromArgb(50, 200, 200, 200);

You have two options - use the Axis.IsInterlaced property or the Axis.StripLines property. This page is a handy reference for customization of the grid lines in a chart.
Here is some sample C# code (from the above reference) -
chart1.ChartAreas[0].AxisY.StripLines.Add(new StripLine());
chart1.ChartAreas[0].AxisY.StripLines[0].BackColor = Color.FromArgb(80, 252, 180, 65);
chart1.ChartAreas[0].AxisY.StripLines[0].StripWidth = 40;
chart1.ChartAreas[0].AxisY.StripLines[0].Interval = 10000;
chart1.ChartAreas[0].AxisY.StripLines[0].IntervalOffset **
HTH, indyfromoz

Related

how to set watermark font size in mpdf

Question is quite simple but unfortunately, i am not able to find solution.
I am trying to add watermark in pdf page. here is the code.
$mpdf->SetDisplayMode('fullpage');
$mpdf->SetWatermarkText('DRAFT');
$mpdf->watermarkTextAlpha = 0.081;
$mpdf->watermark_font = 'DejaVuSansCondensed';
$mpdf->showWatermarkText = true;
$mpdf->WriteHTML($html);
Above code work fine but size of Watermark is quite big.
I want to make it smaller.
I read the documentation but didn't found fontsize for watermark.
I set the watermark fontsize by modifying watermark function in mpdf.php:
Example:
function watermark($texte, $angle = 45, $fontsize = 120, $alpha = 0.2) {
$fontsize = 24
}

How to apply the alphaMaskFilter in Flash CC using Easel.js?

I am working in a canvas document using Flash CC and have the following labeled moveclips on the stage mask_mc (which is a movieclip with a alpha gradient) and logo. The objective is to create a sheen going across the logo.
var mask_mc = this.mask_mc;
mask_mc.cache(0, 0, 232, 196);
var logo = this.logo;
logo.cache(0, 0, 271, 40);
logo.filters = [
new createjs.AlphaMaskFilter(mask_mc.cacheCanvas)
];
All I am trying to do is emulate what an alpha gradient mask used to do using AS3, but can't get it to work with the above code:
//Original AS3 code
mask_mc.cacheAsBitmap = true;
logo.cacheAsBitmap = true;
logo.mask = mask_mc;
Thanks!
You have to cache (or updateCache) after you apply the filter(s)
var logo = this.logo;
logo.filters = [
new createjs.AlphaMaskFilter(mask_mc.cacheCanvas)
];
logo.cache(0, 0, 271, 40);
Your second example will not work because the mask property requires a Shape, and will not work with a canvas/cache.

When using AlivePDF library in Flex the beginFill method sets font colour rather than background colour

Code sample:
var headerRowBackground:RGBColor = new RGBColor(0);
headerRowBackground.b = 58;
headerRowBackground.g = 28;
headerRowBackground.r = 255;
printPDF.beginFill(headerRowBackground);
printPDF.addCell(30, 20, "Room");
The word "Room" is in red, as is the rest of the text in the PDF. I actually want to make the cell background colour red. Anybody know why this doesn't work?
You should look at the API more:
printPDF.addCell(30, 20, 'Room', 0, 0, '1', 0xFF0000);
The documentation is wrong, the fill parameter is described as "Link can be internal to do document level navigation (InternalLink) or external (HTTPLink)".
The code to get this working is:
printPDF.beginFill(new RGBColor(0xFF0718));
printPDF.textStyle(new RGBColor(0x000000));
printPDF.addCell(30, 10, "Room", 0, 0, Align.LEFT, 1);
A couple of things about the code:
The fill parameter should be 0 or 1
rather than the fill value. It just
either switches on or off the fill
value previously set.
The text style
should be set too otherwise the text
and background will use the same
colour

Change GDI pen colour

Is it possible to change the custom pen colour attribute after creating it using this call?
HPEN hPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0)); //Create a solid pen.
or how should i create a pen whose colour colour can be changed.
I am afraid that this is not possible using any non-esoteric approach.
I think, however, that you can use the DC_PEN stock object and the SetDCPenColor function, like so:
SelectObject(dc, GetStockObject(DC_PEN));
SetDCPenColor(dc, clGreen);
Rectangle(dc, 10, 10, 200, 200);
SetDCPenColor(dc, clRed);
Rectangle(dc, 300, 300, 500, 500);
in Delphi syntax.

Rotate a drawn rectangle in flex

i wrote the following code for drawing a rotate rectangle
var s:UIComponent = new UIComponent();
s.graphics.lineStyle(1, 0x0000FF);
s.graphics.drawRect(50, 50, 200, 200);
s.rotation = 30;
template.addChild(s);
where template is a canvas. Its rotate nicely but the problem is the position is not in right place. i.e. it is not in (50,50) after rotate. How can i solve this problem?
Thanks in advance.
What you're seeing is the default rotation around the origin in Flex (in your case the X,Y coordinates of 50,50) I am assuming that you want to rotate around the center (as I recently had to do). There is the jury rig way to do it, by adjusting the origin point based on rotation angle. Then there is the rotate effect:
import mx.effects.Rotate;
var s:UIComponent = new UIComponent();
var rotator:Rotate = new Rotate(s);
s.graphics.lineStyle(1, 0x0000FF);
s.graphics.drawRect(50, 50, 200, 200);
rotator.angleFrom = 0;
rotator.angleTo = 30;
rotator.originX = s.width/2;
rotator.originY = s.height/2;
template.addChild(s);
rotator.play();
Now I've noticed some problems with this that required me to set the width and height of the rotated object again after the play() method, but other than that I get the ideal rotation situation.
Another downside to this is that it's an effect, which means it visually rotates the object. I will post back when I correct that, if you don't want to see the object rotate.
The Answer is duration
just by adding rotator.duration = 1 before play it happens so quick the user won't see it. 1 being 1 millisecond. I tried 0, but that resulted in no rotation occurring. Obviously if you want to see the effect in action you can increase that length of time by using any value in milliseconds.

Resources