
Product
Introducing Socket MCP for Claude Desktop
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
otter-chart
Advanced tools
基于lightweight-charts开发的图表库,覆盖了lightweight-charts
的所有能力,并基于lightweight-charts
的API
进行了一些扩展,使其更加适合在OtterTrade
项目中使用。
npm install otter-chart # or yarn add otter-chart or pnpm add otter-chart
可在浏览器中直接引入,也可在
webpack、vite
等打包工具中引入。其中浏览器中直接引入时,会挂载到window.OtterChart
对象上
默认导出了lightweight-charts
的所有能力,使用方式与lightweight-charts
一致,只是将lightweight-charts
替换为otter-chart
即可。
initChart
:带有默认配置的图表初始化方法
csvToJson
: 将csv
数据转换为json
数据
fileToJson
:将csv
格式的文件类型转换为json
数据
time
时间类型为unix
时间戳,单位为秒
//类型定义
export type ChartDataType = {
close: number | string;
high: number | string;
low: number | string;
open: number | string;
time: UTCTimestamp;
volume: number | string;
};
//示例值为:
{
close: '7185.88',
high: '7195.52',
low: '7183.0',
open: '7195.36',
time: 1577835000,
volume: '696.1179999999999',
},
//类型定义
export type OrderDataType = {
balance: number | string;
drawdown: number | string;
price: number | string;
quantity: number | string;
time: UTCTimestamp;
type: 'BUY' | 'SELL';
};
//示例值为:
{
balance: '664.04',
drawdown: '36.79',
price: '7081.79',
quantity: '0.093',
time: 1576479600,
type: 'BUY',
}
// webpack相关项目中使用
import { initChart } from 'otter-chart';
// initChart的首要参数为需要初始化的domId值或者dom实例
const { chart } = initChart('chart', {
width: 1000,
height: 350,
});
chart.setChartData(chartData);
chart.setOrderData(orderData);
FAQs
otter-chart图表库
The npm package otter-chart receives a total of 0 weekly downloads. As such, otter-chart popularity was classified as not popular.
We found that otter-chart demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.