Below is my code to display highcharts, now in the chart goal is showed on mouse over. i want to display it as thin line:
options.series[1] = new Object();
options.series[1].name = "Goal Points";
options.series[1].data = Goallimit;
options.series[1].type = 'arearange';
options.series[1].lineWidth = 0;
options.series[1].linkedTo = ':previous';
options.series[1].color = '#A6E685';
options.series[1].fillOpacity = 0.3;
options.series[1].zIndex = 0;!
Here is Highchart image
Related
I've defined a Rectangle in the XAML named "MyRectangle" and when clicked I execute this code:
auto animation = ref new Windows::UI::Xaml::Media::Animation::DoubleAnimation();
animation->From = 0.01;
animation->To = 5.50;
animation->AutoReverse = true;
auto beginTime = Windows::Foundation::TimeSpan();
beginTime.Duration = 0;
animation->BeginTime = beginTime;
auto duration = Windows::Foundation::TimeSpan();
duration.Duration = 20000*1000;
animation->Duration = duration;
auto storyboard = ref new Windows::UI::Xaml::Media::Animation::Storyboard();
auto scaleTransform = ref new Windows::UI::Xaml::Media::ScaleTransform();
MyRectangle->RenderTransform = scaleTransform;
storyboard->SetTargetProperty(animation, "(Rectangle.RenderTransform).(ScaleTransform.ScaleX)");
storyboard->SetTarget(animation, MyRectangle);
storyboard->SetTargetName(animation, "MyRectangle");
storyboard->SpeedRatio = 1.0;
storyboard->Begin();
However, nothing happens. What am I doing wrong?
You must add the "animation" (or more animations) to the "storyboard" childrens:
storyboard->Children->Append(animation);
This is the C# equivalent:
https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.animation.storyboard
I am using VB.NET and I have added buttons and text edits in a windows form.
When I press maximize button, the buttons and text edits do not cover the entire windows form.
I have checked the Docking method, but it works when I have few controls (like 2 or 3 buttons).
I will need to add around 20 button controls in the form.
How do I make sure the controls will move accordingly when the window form is maximized?
Thank you.
It's not so obvious to automatically adapt the position of your child controls when the parent control resizes in Windows Forms, but do you really want that ?
It seems like a terrible idea for usability.
If you want to achieve this though, you should use a TableLayoutPanel, set the size of the columns/rows to a certain percentage and then fill the panel with your controls. Here is some sample code:
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(7, 0);
this.label1.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(84, 25);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
this.label2.AutoSize = true;
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(105, 0);
this.label2.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(84, 25);
this.label2.TabIndex = 1;
this.label2.Text = "label2";
this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanel1.AutoSize = true;
this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.label2, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(147, 107);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(196, 25);
this.tableLayoutPanel1.TabIndex = 3;
Here is the situation. In my app I have an overlay layer that is composed of a transparent PNG. I have replaced the hitarea for the png with a 1x1 image using the following code:
[Bindable]
[Embed(source = "/assets/1x1image.png")]
private var onexonebitmapClass:Class;
private function loadCompleteHandler(event:Event):void
{
// Create the bitmap
var onexonebitmap:BitmapData = new onexonebitmapClass().bitmapData;
var bitmap:Bitmap;
bitmap = event.target.content as Bitmap;
bitmap.smoothing = true;
var _hitarea:Sprite = createHitArea(onexonebitmap, 1);
var rect:flash.geom.Rectangle = _box.toFlexRectangle(sprite.width, sprite.height);
var drawnBox:Sprite = new FlexSprite();
bitmap.width = rect.width;
bitmap.height = rect.height;
bitmap.x = -loader.width / 2;
bitmap.y = -loader.height / 2;
bitmap.alpha = _alpha;
_hitarea.alpha = 0;
drawnBox.x = rect.x + rect.width / 2;
drawnBox.y = rect.y + rect.height / 2;
// Add the bitmap as a child to the drawnBox
drawnBox.addChild(bitmap);
// Rotate the object.
drawnBox.rotation = _rotation;
// Add the drawnBox to the sprite
sprite.addChild(drawnBox);
// Set the hitarea to drawnBox
drawnBox.hitArea = _hitarea;
}
private function createHitArea(bitmapData:BitmapData, grainSize:uint = 1):Sprite
{
var _hitarea:Sprite = new Sprite();
_hitarea.graphics.beginFill(0x900000, 1.0);
for (var x:uint = 0; x < bitmapData.width; x += grainSize)
{
for (var y:uint = grainSize; y < bitmapData.height; y += grainSize)
{
if (x <= bitmapData.width && y <= bitmapData.height && bitmapData.getPixel(x, y) != 0)
{
_hitarea.graphics.drawRect(x, y, grainSize, grainSize);
}
}
}
_hitarea.graphics.endFill();
return _hitarea;
}
This is based off the work done here: Creating a hitarea for PNG Image with transparent (alpha) regions in Flex
Using the above code I am able to basically ignore the overlay layer for all mouse events (click, double click, move, etc.) However, I am unable to capture the right click (context menu) event for items that are beneath the overlay.
For instance I have a spell check component that checks the spelling on any textitem and like most other spell checkers if the word is incorrect or not in the dictionary underlines the word in red and if you right click on it would give you a list of suggestions in the contextmenu. This is working great when the text box is not under the overlay, but if the text box is under the overlay I get nothing back.
If anyone can give me some pointers on how to capture the right click event on a textItem that is under a transparent png that would be great.
How do I add a drop shadow (with defined distance, size etc) using Photoshop scripting?
Current JS Code
var fontSize = 14;
var fontName = "Arial-Bold"; // NB: must be postscript name of font!
// This is the colour of the text in RGB
//Click foreground colour in Photoshop, choose your colour and read off the RGB values
//these can then be entered below.
var textColor = new SolidColor();
textColor.rgb.red = 255;
textColor.rgb.green =255;
textColor.rgb.blue = 255;
var newTextLayer = doc.artLayers.add();
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.size = fontSize;
newTextLayer.textItem.font = fontName;
newTextLayer.textItem.contents = ++Count;
newTextLayer.textItem.color = textColor;
newTextLayer.textItem.kind = TextType.PARAGRAPHTEXT;
newTextLayer.textItem.height = fontSize;
newTextLayer.textItem.width = doc.width -20;
//The line below is the text position (X Y) IE; 10 Pixels Right 10 Pixels Down
newTextLayer.textItem.position = Array(10, 12);
// Can be RIGHTJUSTFIED LEFTJUSTIFIED CENTERJUSTIFIED
newTextLayer.textItem.justification=Justification.CENTERJUSTIFIED;
I believe there is no API function for this.
The best you can do is to use Scriptlistner.
The code that it generates then can be used in your script.
Here are some similar discussion with Scriptlistner-generated code:
http://ps-scripts.com/bb/viewtopic.php?t=586
or
http://ps-scripts.com/bb/viewtopic.php?t=2207
I have been trying to plot a map on axmapcontrol and use the same ITable to create a scatterplot graph in IDataGraphwindow2. Unfortunately the graph appears with correct data but no click events on the graph are working. The left click shows a memory error and the right click shows a disabled menu. For left click I think DataGraphTUI.dll is responsible. When we load the IDataGraphWindow2, we don’t initialize this due to which probably it gives an error.
Please find the code below.
IDataGraphWindow2 pDGWin;
IDataGraphT dataGraphT = new DataGraphTClass();
IWorkspace shapefileWorkspace = null;
IWorkspaceFactory shapefileWorkspaceFactory = new ShapefileWorkspaceFactoryClass();
shapefileWorkspace = shapefileWorkspaceFactory.OpenFromFile("C:\\abc.shp "), 0);
featureWorkspace = (IFeatureWorkspace)shapefileWorkspace;
featureLayer.FeatureClass = featureWorkspace.OpenFeatureClass(System.IO.Path.GetFileNameWithoutExtension("c:\\abc.shp"));
ITable gobjJoinedTable = (ITable)featureLayer.FeatureClass;
LoadaxMap(); /// a method to load up the axmapcontrol
dataGraphT.UseSelectedSet = true;
dataGraphT.HighlightSelection = true;
dataGraphT.GeneralProperties.Title = "Scatter Graph";
dataGraphT.LegendProperties.Visible = false;
dataGraphT.get_AxisProperties(0).Title = "Y Axis";
dataGraphT.get_AxisProperties(0).Logarithmic = false;
dataGraphT.get_AxisProperties(2).Title = "X Axis";
dataGraphT.get_AxisProperties(2).Logarithmic = false;
ISeriesProperties seriesProps = dataGraphT.AddSeries("scatter_plot");
seriesProps.SourceData = axMap.get_Layer(0) as ITable; // axMap is the map control. Itable direct binding also works here
seriesProps.SetField(0, "abc.shp-fieldname"); // you may add any fieldname
seriesProps.SetField(1, "abc.shp-fieldname");
dataGraphT.Update(null);
dataGraphT.UseSelectedSet = true;
dataGraphT.HighlightSelection = false;
dataGraphT.Update(null);
pDGWin = new DataGraphWindowClass();
pDGWin.DataGraphBase = dataGraphT;
pDGWin.PutPosition(546, 155, 1040, 540);
pDGWin.Show(true);
The memory error is
Access violation at address 0F4E358B in module 'DatagraphTUI.dll'. Read of addess 00000000
Had the same problem while displaying the graph.
Fixed it by using this line of code:
graphWindow.Application = ArcMap.Application
All it needs is a reference to the ArcMap Application.