Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beta.800 #1056

Merged
merged 150 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
3b002ec
#859 Do not override tooltip in InitializeCore method - user wouldn't…
Apr 20, 2023
810d1ed
pack debug on default
beto-rodriguez May 7, 2023
93d4818
typo, remove unused ns
beto-rodriguez May 15, 2023
dcca6a2
Cleaner animations api
beto-rodriguez May 15, 2023
fe019d4
simplify animations api
beto-rodriguez May 15, 2023
f9364f6
simplify delayed animation sample
beto-rodriguez May 15, 2023
c20902a
introduce the concept to parents in geometries
beto-rodriguez May 16, 2023
1e5a92e
docs for layouts
beto-rodriguez May 16, 2023
3bfdd34
remove obsoletes
beto-rodriguez May 16, 2023
b98e226
improve visuals animations api
beto-rodriguez May 17, 2023
b5551fe
fixed labels measure method
beto-rodriguez May 17, 2023
0c45f67
restore tooltip
beto-rodriguez May 17, 2023
3dc444f
simplifying visuals
beto-rodriguez May 17, 2023
4458ac0
update custom controls
beto-rodriguez May 17, 2023
74342f1
update visuals event args
beto-rodriguez May 17, 2023
c5605b7
assert axis tests?
beto-rodriguez May 17, 2023
eed0d7e
stack panel tests
beto-rodriguez May 18, 2023
f36668a
restore this
beto-rodriguez May 18, 2023
04f6e02
fix relative panels
beto-rodriguez May 19, 2023
b5be113
relative panel test
beto-rodriguez May 19, 2023
51abcff
comments
beto-rodriguez May 19, 2023
073d5c1
Merge remote-tracking branch 'origin/master' into better-own-visuals
beto-rodriguez May 19, 2023
409db3b
clean tooltips
beto-rodriguez May 19, 2023
b3c1ef9
cleaner legend
beto-rodriguez May 19, 2023
3408d2c
hidden legend pos
beto-rodriguez May 19, 2023
8df5785
wrap items in panels
beto-rodriguez May 20, 2023
f3db2d8
c#11
beto-rodriguez May 20, 2023
2081759
horizontal panel wrap
beto-rodriguez May 20, 2023
36f16e1
do not write image on disk
beto-rodriguez May 20, 2023
0540639
enable the new wrap behavior in legends
beto-rodriguez May 20, 2023
c50617a
copy children
beto-rodriguez May 20, 2023
a636e57
also test panel dimensions
beto-rodriguez May 20, 2023
80a3d17
Also legends
beto-rodriguez May 22, 2023
2025032
Merge pull request #985 from maagy/dev
beto-rodriguez May 22, 2023
7648a06
restore samples
beto-rodriguez May 22, 2023
c5902b4
table layout
beto-rodriguez May 24, 2023
61a6770
add table alignment
beto-rodriguez May 24, 2023
787befc
tooltips using table layout
beto-rodriguez May 24, 2023
304aa80
multiline labels on financial series
beto-rodriguez May 24, 2023
a0e7e22
remove commented code.
beto-rodriguez May 24, 2023
d2936ea
remove obsolete tooltip methods
beto-rodriguez May 24, 2023
67f6e91
Classify tests in folders
beto-rodriguez May 24, 2023
5045b86
test table layout empty cells
beto-rodriguez May 24, 2023
80f7be9
by cell alignment
beto-rodriguez May 24, 2023
0c16c66
a try for #519
beto-rodriguez May 24, 2023
07796b4
update tests
beto-rodriguez May 25, 2023
8d5b888
Merge pull request #1021 from beto-rodriguez/better-own-visuals
beto-rodriguez May 25, 2023
cdf7070
fire tooltips always, temporally disable tooltip position corrections
beto-rodriguez May 25, 2023
efa46de
Improve tooltip hide method
beto-rodriguez May 25, 2023
25cbb79
correct tooltip position
beto-rodriguez May 25, 2023
4a92e25
draw current tooltip always
beto-rodriguez May 25, 2023
02f8357
better use SuggestedTooltipLocation
beto-rodriguez May 26, 2023
c3615af
test ns
beto-rodriguez May 26, 2023
c0157f7
try auto position
beto-rodriguez May 26, 2023
50ca745
auto correct tooltip positions
beto-rodriguez May 26, 2023
98f85fd
popup geometry and tooltip
beto-rodriguez May 26, 2023
d4361b1
also draw poput outside
beto-rodriguez May 26, 2023
8f6f96f
fix tooltips when negative and positive are mixed
beto-rodriguez May 26, 2023
53b9d0c
also border radius
beto-rodriguez May 26, 2023
ab7c659
tooltip style
beto-rodriguez May 26, 2023
c9e2346
column tooltips tests
beto-rodriguez May 26, 2023
6bac664
tooltips tests for line, and step line
beto-rodriguez May 27, 2023
ba42eaf
restore tooltip animations
beto-rodriguez May 27, 2023
be67f9e
fix scatter series tooltips and tests
beto-rodriguez May 27, 2023
f6ceae5
fix heat series tooltips and tests
beto-rodriguez May 27, 2023
ef1bb77
pupup border color
beto-rodriguez May 27, 2023
ccd21a1
add indexed financial point, fix observable pint bug
beto-rodriguez May 28, 2023
3bce19e
primary and secondary formatters
beto-rodriguez May 28, 2023
45673b7
financial tooltips and tests
beto-rodriguez May 29, 2023
c2d849d
update uno bindables
beto-rodriguez May 29, 2023
05423ce
remove hover paint, instead override OnPointerEnter/Left
beto-rodriguez May 29, 2023
5fab8b5
implement opacity on gradients paints
beto-rodriguez May 29, 2023
5c998b2
finally remove IVisualChartpoint interface....
beto-rodriguez May 29, 2023
dcd0118
simplify core line series
beto-rodriguez May 29, 2023
240cf3e
Fix line series with simplified chartpoints api
beto-rodriguez May 29, 2023
f7351a0
apply siplification to step line series
beto-rodriguez May 29, 2023
e03151d
fixes to pass tests..
beto-rodriguez May 30, 2023
cf80287
tests for visuals change
beto-rodriguez Jun 1, 2023
04b828f
fix and tests polar line series
beto-rodriguez Jun 1, 2023
70f3b80
fix tooltips for polar series
beto-rodriguez Jun 1, 2023
4210a7b
test polar line series scale
beto-rodriguez Jun 1, 2023
de93340
test polar line tooltips
beto-rodriguez Jun 1, 2023
76cab00
place pie tooltips
beto-rodriguez Jun 1, 2023
223be48
test pie position
beto-rodriguez Jun 1, 2023
477a177
test puie position
beto-rodriguez Jun 1, 2023
acb836a
gauges animations
beto-rodriguez Jun 1, 2023
e27499b
hide tooltip when not found
beto-rodriguez Jun 2, 2023
c31f322
fixes to pie tooltips placement
beto-rodriguez Jun 2, 2023
340e6f0
fix for special case
beto-rodriguez Jun 2, 2023
75a596c
better heat series default tooptip labels
beto-rodriguez Jun 2, 2023
ee39e79
only secondary tooltip format
beto-rodriguez Jun 2, 2023
a3fc01d
smart tooltip content
beto-rodriguez Jun 2, 2023
9094157
update api
beto-rodriguez Jun 2, 2023
c56c954
fix tests
beto-rodriguez Jun 2, 2023
31301aa
Merge pull request #1028 from beto-rodriguez/improve-tooltips
beto-rodriguez Jun 2, 2023
3081cdc
fixes #410
beto-rodriguez Jun 4, 2023
ea6df9a
variable geometry sample
beto-rodriguez Jun 4, 2023
0e8d712
update custom geometry samples
beto-rodriguez Jun 4, 2023
ed2eef6
unused using
beto-rodriguez Jun 4, 2023
99b3bbe
reject old legends
beto-rodriguez Jun 4, 2023
5019365
move measure legend to core
beto-rodriguez Jun 4, 2023
cd6269e
do not translate canvas...
beto-rodriguez Jun 4, 2023
1070c50
remove old legends support, clean things up
beto-rodriguez Jun 4, 2023
50ca27d
calculate margins
beto-rodriguez Jun 4, 2023
644dbaa
add tests for legend position
beto-rodriguez Jun 4, 2023
5321403
always draw legends, now it is fast!
beto-rodriguez Jun 4, 2023
50f7a47
tests for legends with title
beto-rodriguez Jun 4, 2023
2f00dfe
test pie legend positions
beto-rodriguez Jun 5, 2023
0acacbe
polar test
beto-rodriguez Jun 5, 2023
6b7a122
remove obsolete startpoint property
beto-rodriguez Jun 5, 2023
8ffd831
update tooltips and legends
beto-rodriguez Jun 5, 2023
7c51b18
Merge pull request #1041 from beto-rodriguez/fixes-731
beto-rodriguez Jun 5, 2023
33dd1e4
test for #795
beto-rodriguez Jun 6, 2023
81b3c88
remove unused things
beto-rodriguez Jun 6, 2023
4abe226
fixes #853
beto-rodriguez Jun 6, 2023
b7b1932
fixes #870
beto-rodriguez Jun 6, 2023
d1c3a16
fixes #874
beto-rodriguez Jun 6, 2023
64e5d7a
fixes #934
beto-rodriguez Jun 7, 2023
7b0ca97
fixe#937
beto-rodriguez Jun 7, 2023
11575e9
testg for #937
beto-rodriguez Jun 7, 2023
df5fbc7
fixes #964
beto-rodriguez Jun 8, 2023
5c831b5
fixes #990
beto-rodriguez Jun 8, 2023
d81b563
fixes #1029
beto-rodriguez Jun 9, 2023
ba7f4bd
ref #1039
beto-rodriguez Jun 9, 2023
674b25c
better use entitymetadata
beto-rodriguez Jun 9, 2023
7e37d9d
add config to samples
beto-rodriguez Jun 9, 2023
1e1b93d
pull code from samples
beto-rodriguez Jun 9, 2023
a1f6b31
add advanced mappers samples
beto-rodriguez Jun 10, 2023
da40b36
update mapper docs, improve related things
beto-rodriguez Jun 10, 2023
bbc99f6
update mappers docs
beto-rodriguez Jun 10, 2023
493582b
Merge pull request #1052 from beto-rodriguez/mappers-docs
beto-rodriguez Jun 10, 2023
c8c2e05
column series labels positioning
beto-rodriguez Jun 11, 2023
dd803cb
Let the user inject logic onPointMeasured
beto-rodriguez Jun 11, 2023
e959984
financial labels test
beto-rodriguez Jun 11, 2023
da8dbe1
fixes #953, heat labels tests
beto-rodriguez Jun 11, 2023
cd9b851
test line series labels
beto-rodriguez Jun 12, 2023
a853e64
add aspieseries oveloads
beto-rodriguez Jun 12, 2023
77c247f
test pie series
beto-rodriguez Jun 12, 2023
59b1e93
sccatter labels tests
beto-rodriguez Jun 12, 2023
5fb47d1
stacked area labels tests
beto-rodriguez Jun 12, 2023
5f1da0b
stacked clolumn, stacked step and step labels tests
beto-rodriguez Jun 12, 2023
2322baa
Merge pull request #1055 from beto-rodriguez/data-labels
beto-rodriguez Jun 12, 2023
8a73359
update to latest api
beto-rodriguez Jun 12, 2023
1b7633c
update avalonia sample to 0.10.21
beto-rodriguez Jun 12, 2023
b0bc4c6
improve custom legend sample
beto-rodriguez Jun 12, 2023
5755dad
improve custom tooltip sample
beto-rodriguez Jun 12, 2023
c29d8a1
update avalonia motion cavnas to preview branch
beto-rodriguez Jun 12, 2023
8a95e95
update to beta.800 version
beto-rodriguez Jun 12, 2023
9884439
fix codefactor warnings
beto-rodriguez Jun 12, 2023
c36864c
indentation
beto-rodriguez Jun 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,9 @@ healthchecksdb
samples/XamarinSample/XamarinSample/XamarinSample.Android/XamarinSample.Android.csproj
samples/XamarinSample/XamarinSample/XamarinSample.Android/Resources/Resource.designer.cs
nuget.exe

# Yes it is recommended to share the *.snk, but there are few reasons
# other than the ones mentioned in the next link that makes me want to keep this private, also singed.
# https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/strong-naming#create-strong-named-net-libraries
*LiveCharts.snk
build/pack.singed.ps1
545 changes: 118 additions & 427 deletions LiveCharts.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/pack.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
param([string]$configuration = "Release", [string]$nupkgOutputPath = "./nupkg")
param([string]$configuration = "Debug", [string]$nupkgOutputPath = "./nupkg")

[Project[]]$projects = @(
[Project]::new("./src/LiveChartsCore/LiveChartsCore.csproj")
Expand Down
7 changes: 7 additions & 0 deletions build/pack.singed.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
& $PSScriptRoot\pack.ps1 Release

& dotnet nuget push **/*.nupkg --api-key oy2o6gainuded3gc42sq2gddywqhhhiu3cxtns4lokf5hu --source https://api.nuget.org/v3/index.json --skip-duplicate

## this should only be ran once?
## dotnet nuget add source --username beto-rodriguez --password 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 --store-password-in-clear-text --name github "https://nuget.pkg.github.com/beto-rodriguez/index.json"
& dotnet nuget push **/*.nupkg --api-key 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 --source "github" --skip-duplicate
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this api key was exposed, and it was removed.

161 changes: 0 additions & 161 deletions docs/cartesianChart/columnseries.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,165 +180,4 @@ to create backgrounds for columns, take a look at the following sample:
}
};</code></pre>

## Plotting custom types

You can teach LiveCharts to plot anything, imagine the case where we have an array of the `City` class defined bellow:

<pre><code>public class City
{
public string Name { get; set; }
public double Population { get; set; }
public double LandArea { get; set; }
}</code></pre>

You can register this type **globally**, this means that every time LiveCharts finds a `City` instance in a chart
it will use the mapper we registered, global mappers are unique for a type, if you need to plot multiple
properties then you should use local mappers.

<pre><code>// Ideally you should call this when your application starts
// If you need help to decide where to add this code
// please see the installation guide in this docs.

// in this case we have an array of the City class
// we need to compare the Population property of every city in our array

LiveCharts.Configure(config =>
config
.HasMap&lt;City>((city, point) =>
{
// in this lambda function we take an instance of the City class (see city parameter)
// and the point in the chart for that instance (see point parameter)
// LiveCharts will call this method for every instance of our City class array,
// now we need to populate the point coordinates from our City instance to our point

// in this case we will use the Population property as our primary value (normally the Y coordinate)
point.PrimaryValue = (float)city.Population;

// then the secondary value (normally the X coordinate)
// will be the index of city in our cities array
point.SecondaryValue = point.Context.Index;

// but you can use another property of the city class as the X coordinate
// for example lets use the LandArea property to create a plot that compares
// Population and LandArea in chart:

// point.SecondaryValue = (float)city.LandArea;
})
.HasMap&lt;Foo>(...) // you can register more types here using our fluent syntax
.HasMap&lt;Bar>(...)
);</code></pre>

Now we are ready to plot cities all over our application:

<pre><code>Series = new[]
{
new ColumnSeries&lt;City>
{
Name = "Population",
TooltipLabelFormatter = point => $"{point.Model.Name} {point.PrimaryValue:N2}M",
Values = new[]
{
new City { Name = "Tokyo", Population = 4, LandArea = 3 },
new City { Name = "New York", Population = 6, LandArea = 4 },
new City { Name = "Seoul", Population = 2, LandArea = 1 },
new City { Name = "Moscow", Population = 8, LandArea = 7 },
new City { Name = "Shanghai", Population = 3, LandArea = 2 },
new City { Name = "Guadalajara", Population = 4, LandArea = 5 }
}
}
};</code></pre>

![image]({{ assets_url }}/docs/_assets/columnct.png)

Alternatively you could create a **local** mapper that will only work for a specific series, global mappers will be
ignored when the series `Mapping` property is not null.

<pre><code>var cities = new[]
{
new City { Name = "Tokyo", Population = 4, LandArea = 3 },
new City { Name = "New York", Population = 6, LandArea = 4 },
new City { Name = "Seoul", Population = 2, LandArea = 1 },
new City { Name = "Moscow", Population = 8, LandArea = 7 },
new City { Name = "Shanghai", Population = 3, LandArea = 2 },
new City { Name = "Guadalajara", Population = 4, LandArea = 5 }
};

Series = new[]
{
// this series draws the Population property in the Y axis
new ColumnSeries&lt;City>
{
Name = "Population",
TooltipLabelFormatter = (point) => $"{point.Model.Name} population: {point.PrimaryValue:N2}M",
Values = cities,
Mapping = (city, point) =>
{
point.PrimaryValue = (float)city.Population;
point.SecondaryValue = point.Context.Index;
}
},

// draws the LandArea property in the Y axis
new ColumnSeries&lt;City>
{
Name = "Population",
TooltipLabelFormatter = (point) => $"{point.Model.Name} area: {point.PrimaryValue:N2}KM2",
Values = cities,
Mapping = (city, point) =>
{
point.PrimaryValue = (float)city.LandArea;
point.SecondaryValue = point.Context.Index;
}
}
};</code></pre>

![image]({{ assets_url }}/docs/_assets/columnctl.png)

## Custom geometries

You can use any geometry to represent a point in a line series.

![image]({{ assets_url }}/docs/_assets/barscustom.png)

<pre><code>Series = new List&lt;ISeries>
{
// use the second type argument to specify the geometry to draw for every point
// there are already many predefined geometries in the
// LiveChartsCore.SkiaSharpView.Drawing.Geometries namespace
new ColumnSeries&lt;double, LiveChartsCore.SkiaSharpView.Drawing.Geometries.OvalGeometry>
{
Values = new List&lt;double> { 4, 2, 0, 5, 2, 6 },
Fill = new SolidColorPaint(SKColors.CornflowerBlue)
},

// you can also define your own geometry using SVG
new ColumnSeries&lt;double, MyGeometry>
{
Values = new List&lt;double> { 3, 2, 3, 4, 5, 3 },
Stroke = null,
Fill = new SolidColorPaint(SKColors.Coral, 5)
}
};</code></pre>

Where `MyGeometry` class is our custom shape, you can draw anything `SkiaSharp` supports at this point,
but in this case we will draw an SVG path, we inherit from `SVGPathGeometry`, and for performance reasons
we use a static variable to parse the SVG path, this ways the parse operation only runs once.

<pre><code>public class MyGeometry : SVGPathGeometry
{
// the static field is important to prevent the svg path is parsed multiple times // mark
// Icon from Google Material Icons font.
// https://fonts.google.com/icons?selected=Material%20Icons%20Outlined%3Amy_location%3A
public static SKPath svgPath = SKPath.ParseSvgPathData(
"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 " +
"11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 " +
"3.13 7 7-3.13 7-7 7z");

public MyGeometry()
: base(svgPath)
{

}
}</code></pre>

{{ render this "~/shared/series2.md" }}
112 changes: 1 addition & 111 deletions docs/cartesianChart/financialseries.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,114 +123,4 @@ Series = new ISeries[]
}
};</code></pre>

## Plotting custom types

You can teach LiveCharts to plot anything, imagine the case where we have an array of the `Stock` class defined bellow:

<pre><code>public class Stock
{
public DateTime Date { get; set; }
public double Open { get; set; }
public double Close { get; set; }
public double High { get; set; }
public double Low { get; set; }
}</code></pre>

You can register this type **globally**, this means that every time LiveCharts finds a `Stock` instance in a chart
it will use the mapper we registered, global mappers are unique for a type, if you need to plot multiple
properties then you should use local mappers.

<pre><code>// Ideally you should call this when your application starts
// If you need help to decide where to add this code
// please see the installation guide in this docs.

// in this case we have an array of the Stock class

LiveCharts.Configure(config =>
config
.HasMap&lt;Stock>((stock, point) =>
{
// in this lambda function we take an instance of the City class (see city parameter)
// and the point in the chart for that instance (see point parameter)
// LiveCharts will call this method for every instance of our City class array,
// now we need to populate the point coordinates from our City instance to our point

point.SecondaryValue = stock.Date.Ticks; // use the date for the X axis (secondary)

// now LiveCharts uses Primary (high), Tertiary (open)
// Quaternary (close) and Quinary (low) planes to represent
// a financial point:

point.PrimaryValue = (float)stock.High;
point.TertiaryValue = (float)stock.Open;
point.QuaternaryValue = (float)stock.Close;
point.QuinaryValue = (float)stock.Low;
})
.HasMap&lt;Foo>(...) // you can register more types here using our fluent syntax
.HasMap&lt;Bar>(...)
);</code></pre>

Now we are ready to plot stock all over our application:

<pre><code>var stockData = new[]
{
new Stock
{
Date = new DateTime(2021, 1, 1),
Open = 200f,
Close = 280f,
High = 290f,
Low = 180f
},
new Stock
{
Date = new DateTime(2021, 1, 2),
Open = 280f,
Close = 220f,
High = 320f,
Low = 210f
}
};

XAxes = new[]
{
// set the UnitWidth to "days" to support date time scaled points.
new Axis
{
UnitWidth = TimeSpan.FromDays(1).Ticks,
LabelsRotation = 20,
Labeler = p => new DateTime((long)p).ToShortDateString(),
MinStep = TimeSpan.FromDays(1).Ticks
}
};

Series = new[]
{
new CandlesticksSeries&lt;Stock>
{
TooltipLabelFormatter =
(p) => $"H: {p.PrimaryValue:N2}, O: {p.TertiaryValue:N2}, C: {p.QuaternaryValue:N2}, L: {p.QuinaryValue:N2}",
Values = stockData
}
};</code></pre>

![image]({{ assets_url }}/docs/_assets/financialct.png)

Alternatively you could create a **local** mapper that will only work for a specific series, global mappers will be
ignored when the series `Mapping` property is not null.

<pre><code>Series = new[]
{
new CandlesticksSeries&lt;Stock>
{
Mapping = (stock, point) =>
{
point.SecondaryValue = stock.Date.Ticks;
point.PrimaryValue = (float)stock.High;
point.TertiaryValue = (float)stock.Open;
point.QuaternaryValue = (float)stock.Close;
point.QuinaryValue = (float)stock.Low;
},
Values = stockData
}
};</code></pre>
{{ render this "~/shared/series2.md" }}