mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-02-04 05:35:44 +00:00
25 lines
574 B
C#
25 lines
574 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Radzen.Blazor
|
|
{
|
|
internal class OrdinalScale : LinearScale
|
|
{
|
|
public IList<object> Data { get; set; }
|
|
|
|
public override object Value(double value)
|
|
{
|
|
return Data.ElementAtOrDefault(Convert.ToInt32(value));
|
|
}
|
|
|
|
public override (double Start, double End, double Step) Ticks(int distance)
|
|
{
|
|
var start = -1;
|
|
var end = Data.Count;
|
|
var step = 1;
|
|
|
|
return (start, end, step);
|
|
}
|
|
}
|
|
} |