Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
livecharts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
livecharts
Commits
234e9b5e
Commit
234e9b5e
authored
Aug 04, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决了问题。 手动断开 DataLabelViewModel 与 ContentControl 的联系。 让GC可以释放
parent
176bb4df
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
ColumnRangeExample.xaml
WpfApp1/ColumnRangeExample.xaml
+2
-1
ColumnRangeExample.xaml.cs
WpfApp1/ColumnRangeExample.xaml.cs
+9
-3
ColumnPointView.cs
WpfView/Points/ColumnPointView.cs
+3
-0
No files found.
WpfApp1/ColumnRangeExample.xaml
View file @
234e9b5e
...
...
@@ -31,7 +31,8 @@
<TextBlock Text="运行中"/>
<TextBlock Text="{Binding IsRunning,Mode=OneWay}"/>
</StackPanel>
<Button Content="Update" Width="80" Padding="5" Click="Button_Click"/>
<Button Content="定时更新" Width="80" Padding="5" Click="Button_Click"/>
<Button Content="清空" Width="80" Padding="5" Click="ButtonClear_Click"/>
<Button Content="GC" Width="80" Padding="5" Click="ButtonGC_Click"/>
</StackPanel>
</Grid>
...
...
WpfApp1/ColumnRangeExample.xaml.cs
View file @
234e9b5e
...
...
@@ -46,6 +46,12 @@ namespace WpfApp1
{
GC
.
Collect
();
}
private
void
ButtonClear_Click
(
object
sender
,
RoutedEventArgs
e
)
{
viewModel
.
BoltValues
.
Clear
();
}
}
public
class
ColumnRangeExampleViewModel
:
INotifyPropertyChanged
{
...
...
@@ -61,8 +67,8 @@ namespace WpfApp1
List
<
double
>
datas
=
new
List
<
double
>();
List
<
Bolt
>
boltmap
=
new
List
<
Bolt
>();
ChartValues
<
BoltValue
>
BoltValues
=
new
ChartValues
<
BoltValue
>();
ChartValues
<
double
>
Values
=
new
ChartValues
<
double
>();
public
ChartValues
<
BoltValue
>
BoltValues
=
new
ChartValues
<
BoltValue
>();
public
ChartValues
<
double
>
Values
=
new
ChartValues
<
double
>();
...
...
@@ -178,7 +184,7 @@ Configuration = Mappers.Weighted<BoltValue>()
Update
();
timer
=
new
DispatcherTimer
();
timer
.
Interval
=
TimeSpan
.
FromSeconds
(
1
);
timer
.
Interval
=
TimeSpan
.
FromSeconds
(
0.
1
);
timer
.
Tick
+=
Timer_Tick
;
}
public
void
Start
()
...
...
WpfView/Points/ColumnPointView.cs
View file @
234e9b5e
...
...
@@ -183,6 +183,9 @@ namespace LiveCharts.Wpf.Points
chart
.
View
.
RemoveFromDrawMargin
(
HoverShape
);
chart
.
View
.
RemoveFromDrawMargin
(
Rectangle
);
chart
.
View
.
RemoveFromDrawMargin
(
DataLabel
);
//feng
DataLabel
.
Content
=
null
;
}
public
override
void
OnHover
(
ChartPoint
point
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment