Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Donate
Please sign in before you donate.
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
1 Star 0 Fork 2

TK-7/oxyplot

forked from anysharp/oxyplot
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (12)
Tags (7)
master
develop
release/v2.2.0
codestyle
skiaupdate
release/v2.1.2
snyk-fix-9fd1aceadf2111de25175cc5fcecf926
release/v2.1.0
release/v2.1.0-Preview1
StemSeriesActualMarker
release/v2.0.0
release/v1.0.0
v2.2.0
v2.1.2
v2.1.0
v2.0.0
v1.0.0
v0.0.1
v0.20141546
master
Branches (12)
Tags (7)
master
develop
release/v2.2.0
codestyle
skiaupdate
release/v2.1.2
snyk-fix-9fd1aceadf2111de25175cc5fcecf926
release/v2.1.0
release/v2.1.0-Preview1
StemSeriesActualMarker
release/v2.0.0
release/v1.0.0
v2.2.0
v2.1.2
v2.1.0
v2.0.0
v1.0.0
v0.0.1
v0.20141546
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (12)
Tags (7)
master
develop
release/v2.2.0
codestyle
skiaupdate
release/v2.1.2
snyk-fix-9fd1aceadf2111de25175cc5fcecf926
release/v2.1.0
release/v2.1.0-Preview1
StemSeriesActualMarker
release/v2.0.0
release/v1.0.0
v2.2.0
v2.1.2
v2.1.0
v2.0.0
v1.0.0
v0.0.1
v0.20141546
oxyplot
/
Source
/
Examples
/
ExampleLibrary
/
Annotations
/
ImageAnnotationExamples.cs
oxyplot
/
Source
/
Examples
/
ExampleLibrary
/
Annotations
/
ImageAnnotationExamples.cs
ImageAnnotationExamples.cs 14.15 KB
Copy Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ImageAnnotationExamples.cs" company="OxyPlot">
// Copyright (c) 2014 OxyPlot contributors
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace ExampleLibrary
{
using System;
using System.Reflection;
using OxyPlot;
using OxyPlot.Annotations;
using OxyPlot.Axes;
using OxyPlot.Series;
[Examples("ImageAnnotation"), Tags("Annotations")]
public static class ImageAnnotationExamples
{
[Example("ImageAnnotation")]
public static PlotModel ImageAnnotation()
{
var model = new PlotModel { Title = "ImageAnnotation", PlotMargins = new OxyThickness(60, 4, 4, 60) };
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
OxyImage image;
var assembly = typeof(ImageAnnotationExamples).GetTypeInfo().Assembly;
using (var stream = assembly.GetManifestResourceStream("ExampleLibrary.Resources.OxyPlot.png"))
{
image = new OxyImage(stream);
}
// Centered in plot area, filling width
model.Annotations.Add(new ImageAnnotation
{
ImageSource = image,
Opacity = 0.2,
Interpolate = false,
X = new PlotLength(0.5, PlotLengthUnit.RelativeToPlotArea),
Y = new PlotLength(0.5, PlotLengthUnit.RelativeToPlotArea),
Width = new PlotLength(1, PlotLengthUnit.RelativeToPlotArea),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Middle
});
// Relative to plot area, inside top/right corner, 120pt wide
model.Annotations.Add(new ImageAnnotation
{
ImageSource = image,
X = new PlotLength(1, PlotLengthUnit.RelativeToPlotArea),
Y = new PlotLength(0, PlotLengthUnit.RelativeToPlotArea),
Width = new PlotLength(120, PlotLengthUnit.ScreenUnits),
HorizontalAlignment = HorizontalAlignment.Right,
VerticalAlignment = VerticalAlignment.Top
});
// Relative to plot area, above top/left corner, 20pt high
model.Annotations.Add(new ImageAnnotation
{
ImageSource = image,
X = new PlotLength(0, PlotLengthUnit.RelativeToPlotArea),
Y = new PlotLength(0, PlotLengthUnit.RelativeToPlotArea),
OffsetY = new PlotLength(-5, PlotLengthUnit.ScreenUnits),
Height = new PlotLength(20, PlotLengthUnit.ScreenUnits),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Bottom
});
// At the point (50,50), 200pt wide
model.Annotations.Add(new ImageAnnotation
{
ImageSource = image,
X = new PlotLength(50, PlotLengthUnit.Data),
Y = new PlotLength(50, PlotLengthUnit.Data),
Width = new PlotLength(200, PlotLengthUnit.ScreenUnits),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top
});
// At the point (50,20), 50 x units wide
model.Annotations.Add(new ImageAnnotation
{
ImageSource = image,
X = new PlotLength(50, PlotLengthUnit.Data),
Y = new PlotLength(20, PlotLengthUnit.Data),
Width = new PlotLength(50, PlotLengthUnit.Data),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top
});
// Relative to the viewport, centered at the bottom, with offset (could also use bottom vertical alignment)
model.Annotations.Add(new ImageAnnotation
{
ImageSource = image,
X = new PlotLength(0.5, PlotLengthUnit.RelativeToViewport),
Y = new PlotLength(1, PlotLengthUnit.RelativeToViewport),
OffsetY = new PlotLength(-35, PlotLengthUnit.ScreenUnits),
Height = new PlotLength(30, PlotLengthUnit.ScreenUnits),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top
});
// Changing opacity
for (int y = 0; y < 10; y++)
{
model.Annotations.Add(
new ImageAnnotation
{
ImageSource = image,
Opacity = (y + 1) / 10.0,
X = new PlotLength(10, PlotLengthUnit.Data),
Y = new PlotLength(y * 2, PlotLengthUnit.Data),
Width = new PlotLength(100, PlotLengthUnit.ScreenUnits),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Bottom
});
}
return model;
}
[Example("ImageAnnotation - gradient backgrounds")]
public static PlotModel ImageAnnotationAsBackgroundGradient()
{
// http://en.wikipedia.org/wiki/Chartjunk
var model = new PlotModel { Title = "Using ImageAnnotations to draw a gradient backgrounds", Subtitle = "But do you really want this? This is called 'chartjunk'!", PlotMargins = new OxyThickness(60, 4, 4, 60) };
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
// create a gradient image of height n
int n = 256;
var imageData1 = new OxyColor[1, n];
for (int i = 0; i < n; i++)
{
imageData1[0, i] = OxyColor.Interpolate(OxyColors.Blue, OxyColors.Red, i / (n - 1.0));
}
var image1 = OxyImage.Create(imageData1, ImageFormat.Png); // png is required for silverlight
// or create a gradient image of height 2 (requires bitmap interpolation to be supported)
var imageData2 = new OxyColor[1, 2];
imageData2[0, 0] = OxyColors.Yellow; // top color
imageData2[0, 1] = OxyColors.Gray; // bottom color
var image2 = OxyImage.Create(imageData2, ImageFormat.Png); // png is required for silverlight
// gradient filling the viewport
model.Annotations.Add(new ImageAnnotation
{
ImageSource = image2,
Interpolate = true,
Layer = AnnotationLayer.BelowAxes,
X = new PlotLength(0, PlotLengthUnit.RelativeToViewport),
Y = new PlotLength(0, PlotLengthUnit.RelativeToViewport),
Width = new PlotLength(1, PlotLengthUnit.RelativeToViewport),
Height = new PlotLength(1, PlotLengthUnit.RelativeToViewport),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top
});
// gradient filling the plot area
model.Annotations.Add(new ImageAnnotation
{
ImageSource = image1,
Interpolate = true,
Layer = AnnotationLayer.BelowAxes,
X = new PlotLength(0, PlotLengthUnit.RelativeToPlotArea),
Y = new PlotLength(0, PlotLengthUnit.RelativeToPlotArea),
Width = new PlotLength(1, PlotLengthUnit.RelativeToPlotArea),
Height = new PlotLength(1, PlotLengthUnit.RelativeToPlotArea),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top
});
// verify that a series is rendered above the gradients
model.Series.Add(new FunctionSeries(Math.Sin, 0, 7, 0.01));
return model;
}
[Example("ImageAnnotation - normal axes")]
public static PlotModel ImageAnnotation_NormalAxes()
{
var model = new PlotModel { Title = "ImageAnnotation - normal axes" };
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
// create an image
var pixels = new OxyColor[2, 2];
pixels[0, 0] = OxyColors.Blue;
pixels[1, 0] = OxyColors.Yellow;
pixels[0, 1] = OxyColors.Green;
pixels[1, 1] = OxyColors.Red;
var image = OxyImage.Create(pixels, ImageFormat.Png);
model.Annotations.Add(
new ImageAnnotation
{
ImageSource = image,
Interpolate = false,
X = new PlotLength(0, PlotLengthUnit.Data),
Y = new PlotLength(0, PlotLengthUnit.Data),
Width = new PlotLength(80, PlotLengthUnit.Data),
Height = new PlotLength(50, PlotLengthUnit.Data),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Bottom
});
return model;
}
[Example("ImageAnnotation - reverse horizontal axis")]
public static PlotModel ImageAnnotation_ReverseHorizontalAxis()
{
var model = new PlotModel { Title = "ImageAnnotation - reverse horizontal axis" };
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, StartPosition = 1, EndPosition = 0 });
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
// create an image
var pixels = new OxyColor[2, 2];
pixels[0, 0] = OxyColors.Blue;
pixels[1, 0] = OxyColors.Yellow;
pixels[0, 1] = OxyColors.Green;
pixels[1, 1] = OxyColors.Red;
var image = OxyImage.Create(pixels, ImageFormat.Png);
model.Annotations.Add(
new ImageAnnotation
{
ImageSource = image,
Interpolate = false,
X = new PlotLength(100, PlotLengthUnit.Data),
Y = new PlotLength(0, PlotLengthUnit.Data),
Width = new PlotLength(80, PlotLengthUnit.Data),
Height = new PlotLength(50, PlotLengthUnit.Data),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Bottom
});
return model;
}
[Example("ImageAnnotation - reverse vertical axis")]
public static PlotModel ImageAnnotation_ReverseVerticalAxis()
{
var model = new PlotModel { Title = "ImageAnnotation - reverse vertical axis" };
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left, StartPosition = 1, EndPosition = 0 });
// create an image
var pixels = new OxyColor[2, 2];
pixels[0, 0] = OxyColors.Blue;
pixels[1, 0] = OxyColors.Yellow;
pixels[0, 1] = OxyColors.Green;
pixels[1, 1] = OxyColors.Red;
var image = OxyImage.Create(pixels, ImageFormat.Png);
model.Annotations.Add(
new ImageAnnotation
{
ImageSource = image,
Interpolate = false,
X = new PlotLength(0, PlotLengthUnit.Data),
Y = new PlotLength(100, PlotLengthUnit.Data),
Width = new PlotLength(80, PlotLengthUnit.Data),
Height = new PlotLength(50, PlotLengthUnit.Data),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Bottom
});
return model;
}
}
}
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

OxyPlot 是一个用于数据可视化的类库,支持多种图表类型,包括折线图、柱状图和饼图等,并具有高度可定制化的特点。 支持跨平台开发,适用于 Windows、macOS 和 Linux,并且可以与多种 C# UI 框架(如 Windows Forms 和 WPF)无缝集成。 通过使用 OxyPlot可以轻松实现数据可视化功能,帮助用户更好地理解和分析数据。
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tk-7/oxyplot.git
git@gitee.com:tk-7/oxyplot.git
tk-7
oxyplot
oxyplot
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /