xml - Xamarin Microcharts extension namespace not recognised -
i building app in xamarin forms. trying simple chart element appear on page when loaded.
i have installed microcharts.forms v0.6.2
package aloïs deniel use in xamarin forms application.
when add line <forms:chartview x:name="chart1"/>
litechartpage.xaml
file, on compile error.
'forms' undeclared prefix. line 8, position 6.
i have using microcharts;
in litechartpage.xaml.cs
file.
here xaml code
<?xml version="1.0" encoding="utf-8" ?> <contentpage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:app1" xmlns:chart="clr-namespace:microcharts.forms;assembly=microcharts.forms" x:class="app1.litechartpage"> <forms:chartview x:name="chart1"/> </contentpage>
here litechartpage.xaml.cs
code:
using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using xamarin.forms; using static skiasharp.skcanvas; using microcharts; using entry = microcharts.entry; namespace app1 { public partial class litechartpage : contentpage { public litechartpage() { microcharts.chart c = new microcharts.barchart(); list<microcharts.entry> entries = new list<microcharts.entry> { new microcharts.entry(200) { color = skiasharp.skcolor.parse("#ff1493"), label = "litecoin price", valuelabel = "200" }, new microcharts.entry(400) { color = skiasharp.skcolor.parse("#bb1493"), label = "bitcoin price", valuelabel = "200" }, new microcharts.entry(-100) { color = skiasharp.skcolor.parse("#ffbbd3"), label = "etherium price", valuelabel = "200" }, }; c.entries = entries; initializecomponent(); } } }
do need add reference forms namespace somewhere?
change prefix of .because here declared namespace in content page chart using forms.
Comments
Post a Comment