Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="nikkei225"></div>
&larr;&rarr;キーで1日単位の横スクロール、および Home キーで原点日(黒い矢印の位置)に戻ることができます。
              
            
!

CSS

              
                
              
            
!

JS

              
                // 今年(2019年)の日経平均日足データ
const Nikkei225 = [
	{"close":19561.96,"high":19692.58,"low":19241.37,"open":19655.13,"time":"2019-01-04"},
	{"close":20038.97,"high":20266.22,"low":19920.8,"open":19944.61,"time":"2019-01-07"},
	{"close":20204.04,"high":20347.92,"low":20106.36,"open":20224.67,"time":"2019-01-08"},
	{"close":20427.06,"high":20494.35,"low":20331.2,"open":20366.3,"time":"2019-01-09"},
	{"close":20163.8,"high":20345.92,"low":20101.93,"open":20270.88,"time":"2019-01-10"},
	{"close":20359.7,"high":20389.89,"low":20294.74,"open":20296.45,"time":"2019-01-11"},
	{"close":20555.29,"high":20571.28,"low":20204.43,"open":20264.82,"time":"2019-01-15"},
	{"close":20442.75,"high":20580.25,"low":20323.32,"open":20575.72,"time":"2019-01-16"},
	{"close":20402.27,"high":20571.75,"low":20342.46,"open":20544.23,"time":"2019-01-17"},
	{"close":20666.07,"high":20682.12,"low":20454.13,"open":20472.81,"time":"2019-01-18"},
	{"close":20719.33,"high":20892.68,"low":20678.26,"open":20848.38,"time":"2019-01-21"},
	{"close":20622.91,"high":20805.93,"low":20558.3,"open":20770.06,"time":"2019-01-22"},
	{"close":20593.72,"high":20686.29,"low":20438.22,"open":20453.44,"time":"2019-01-23"},
	{"close":20574.63,"high":20620.72,"low":20467.59,"open":20506.24,"time":"2019-01-24"},
	{"close":20773.56,"high":20844.31,"low":20598.64,"open":20598.64,"time":"2019-01-25"},
	{"close":20649.0,"high":20759.48,"low":20624.55,"open":20746.29,"time":"2019-01-28"},
	{"close":20664.64,"high":20673.66,"low":20406.22,"open":20555.44,"time":"2019-01-29"},
	{"close":20556.54,"high":20706.27,"low":20527.53,"open":20701.62,"time":"2019-01-30"},
	{"close":20773.49,"high":20869.42,"low":20682.91,"open":20832.91,"time":"2019-01-31"},
	{"close":20788.39,"high":20929.63,"low":20741.98,"open":20797.03,"time":"2019-02-01"},
	{"close":20883.77,"high":20922.58,"low":20823.68,"open":20831.9,"time":"2019-02-04"},
	{"close":20844.45,"high":20981.23,"low":20823.18,"open":20960.47,"time":"2019-02-05"},
	{"close":20874.06,"high":20971.66,"low":20860.99,"open":20928.87,"time":"2019-02-06"},
	{"close":20751.28,"high":20844.77,"low":20665.51,"open":20812.22,"time":"2019-02-07"},
	{"close":20333.17,"high":20562.39,"low":20315.31,"open":20510.5,"time":"2019-02-08"},
	{"close":20864.21,"high":20885.88,"low":20428.57,"open":20442.55,"time":"2019-02-12"},
	{"close":21144.48,"high":21213.74,"low":20992.88,"open":21029.93,"time":"2019-02-13"},
	{"close":21139.71,"high":21235.62,"low":21102.16,"open":21147.89,"time":"2019-02-14"},
	{"close":20900.63,"high":21051.51,"low":20853.33,"open":21051.51,"time":"2019-02-15"},
	{"close":21281.85,"high":21306.36,"low":21189.97,"open":21217.32,"time":"2019-02-18"},
	{"close":21302.65,"high":21344.17,"low":21217.16,"open":21256.58,"time":"2019-02-19"},
	{"close":21431.49,"high":21494.85,"low":21315.39,"open":21346.04,"time":"2019-02-20"},
	{"close":21464.23,"high":21553.35,"low":21318.74,"open":21422.31,"time":"2019-02-21"},
	{"close":21425.51,"high":21451.23,"low":21348.67,"open":21376.36,"time":"2019-02-22"},
	{"close":21528.23,"high":21590.03,"low":21505.07,"open":21567.66,"time":"2019-02-25"},
	{"close":21449.39,"high":21610.88,"low":21405.84,"open":21556.02,"time":"2019-02-26"},
	{"close":21556.51,"high":21578.81,"low":21492.65,"open":21504.61,"time":"2019-02-27"},
	{"close":21385.16,"high":21536.55,"low":21364.09,"open":21536.55,"time":"2019-02-28"},
	{"close":21602.69,"high":21641.58,"low":21490.02,"open":21490.02,"time":"2019-03-01"},
	{"close":21822.04,"high":21860.39,"low":21740.92,"open":21812.81,"time":"2019-03-04"},
	{"close":21726.28,"high":21798.38,"low":21659.04,"open":21712.8,"time":"2019-03-05"},
	{"close":21596.81,"high":21684.6,"low":21550.45,"open":21659.03,"time":"2019-03-06"},
	{"close":21456.01,"high":21472.16,"low":21402.12,"open":21456.88,"time":"2019-03-07"},
	{"close":21025.56,"high":21359.32,"low":20993.07,"open":21339.17,"time":"2019-03-08"},
	{"close":21125.09,"high":21145.94,"low":20938.0,"open":21062.75,"time":"2019-03-11"},
	{"close":21503.69,"high":21568.48,"low":21348.81,"open":21361.61,"time":"2019-03-12"},
	{"close":21290.24,"high":21474.17,"low":21198.99,"open":21425.77,"time":"2019-03-13"},
	{"close":21287.02,"high":21522.75,"low":21287.02,"open":21474.58,"time":"2019-03-14"},
	{"close":21450.85,"high":21521.68,"low":21374.85,"open":21376.73,"time":"2019-03-15"},
	{"close":21584.5,"high":21612.67,"low":21500.32,"open":21576.36,"time":"2019-03-18"},
	{"close":21566.85,"high":21585.55,"low":21425.79,"open":21558.43,"time":"2019-03-19"},
	{"close":21608.92,"high":21614.17,"low":21499.16,"open":21548.65,"time":"2019-03-20"},
	{"close":21627.34,"high":21713.26,"low":21542.03,"open":21713.26,"time":"2019-03-22"},
	{"close":20977.11,"high":21275.43,"low":20911.57,"open":21267.41,"time":"2019-03-25"},
	{"close":21428.39,"high":21460.99,"low":21174.34,"open":21174.34,"time":"2019-03-26"},
	{"close":21378.73,"high":21388.59,"low":21242.52,"open":21353.61,"time":"2019-03-27"},
	{"close":21033.76,"high":21191.32,"low":20974.19,"open":21191.32,"time":"2019-03-28"},
	{"close":21205.81,"high":21267.25,"low":21149.42,"open":21228.51,"time":"2019-03-29"},
	{"close":21509.03,"high":21682.94,"low":21471.12,"open":21500.89,"time":"2019-04-01"},
	{"close":21505.31,"high":21744.64,"low":21490.56,"open":21744.64,"time":"2019-04-02"},
	{"close":21713.21,"high":21722.72,"low":21489.95,"open":21563.64,"time":"2019-04-03"},
	{"close":21724.95,"high":21787.6,"low":21662.9,"open":21724.69,"time":"2019-04-04"},
	{"close":21807.5,"high":21839.18,"low":21731.34,"open":21743.14,"time":"2019-04-05"},
	{"close":21761.65,"high":21900.55,"low":21740.53,"open":21900.55,"time":"2019-04-08"},
	{"close":21802.59,"high":21811.88,"low":21698.42,"open":21750.29,"time":"2019-04-09"},
	{"close":21687.57,"high":21687.57,"low":21571.67,"open":21579.68,"time":"2019-04-10"},
	{"close":21711.38,"high":21721.42,"low":21627.87,"open":21662.65,"time":"2019-04-11"},
	{"close":21870.56,"high":21878.78,"low":21698.71,"open":21782.35,"time":"2019-04-12"},
	{"close":22169.11,"high":22211.03,"low":22102.93,"open":22122.97,"time":"2019-04-15"},
	{"close":22221.66,"high":22261.33,"low":22095.32,"open":22108.15,"time":"2019-04-16"},
	{"close":22277.97,"high":22345.19,"low":22185.87,"open":22236.41,"time":"2019-04-17"},
	{"close":22090.12,"high":22305.63,"low":22058.39,"open":22274.13,"time":"2019-04-18"},
	{"close":22200.56,"high":22250.37,"low":22162.23,"open":22238.07,"time":"2019-04-19"},
	{"close":22217.9,"high":22280.19,"low":22099.38,"open":22188.62,"time":"2019-04-22"},
	{"close":22259.74,"high":22268.37,"low":22119.94,"open":22241.74,"time":"2019-04-23"},
	{"close":2.22e4,"high":22362.92,"low":22125.48,"open":22356.83,"time":"2019-04-24"},
	{"close":22307.58,"high":22334.69,"low":22155.23,"open":22183.32,"time":"2019-04-25"},
	{"close":22258.73,"high":22270.29,"low":22073.1,"open":22167.48,"time":"2019-04-26"},
	{"close":21923.72,"high":22190.49,"low":21875.11,"open":22184.4,"time":"2019-05-07"},
	{"close":21602.59,"high":21639.12,"low":21514.85,"open":21628.04,"time":"2019-05-08"},
	{"close":21402.13,"high":21559.76,"low":21315.07,"open":21492.91,"time":"2019-05-09"},
	{"close":21344.92,"high":21584.09,"low":21175.33,"open":21431.81,"time":"2019-05-10"},
	{"close":21191.28,"high":21277.66,"low":21127.93,"open":21180.74,"time":"2019-05-13"},
	{"close":21067.23,"high":21077.48,"low":20751.45,"open":20870.77,"time":"2019-05-14"},
	{"close":21188.56,"high":21191.53,"low":20968.08,"open":21112.85,"time":"2019-05-15"},
	{"close":21062.98,"high":21153.2,"low":20951.67,"open":21153.2,"time":"2019-05-16"},
	{"close":21250.09,"high":21398.85,"low":21199.98,"open":21246.86,"time":"2019-05-17"},
	{"close":21301.73,"high":21430.06,"low":21282.65,"open":21305.97,"time":"2019-05-20"},
	{"close":21272.45,"high":21318.8,"low":21160.43,"open":21211.26,"time":"2019-05-21"},
	{"close":21283.37,"high":21404.54,"low":21266.98,"open":21373.52,"time":"2019-05-22"},
	{"close":21151.14,"high":21209.56,"low":21072.72,"open":21180.24,"time":"2019-05-23"},
	{"close":21117.22,"high":21117.22,"low":20922.0,"open":20980.79,"time":"2019-05-24"},
	{"close":21182.58,"high":21232.38,"low":21113.76,"open":21148.46,"time":"2019-05-27"},
	{"close":21260.14,"high":21297.7,"low":21177.27,"open":21187.17,"time":"2019-05-28"},
	{"close":21003.37,"high":21071.73,"low":20884.61,"open":21055.42,"time":"2019-05-29"},
	{"close":20942.53,"high":20942.53,"low":20809.29,"open":20881.5,"time":"2019-05-30"},
	{"close":20601.19,"high":20823.1,"low":20581.58,"open":20785.21,"time":"2019-05-31"},
	{"close":20410.88,"high":20438.03,"low":20305.74,"open":20327.87,"time":"2019-06-03"},
	{"close":20408.54,"high":20464.57,"low":20289.64,"open":20435.86,"time":"2019-06-04"},
	{"close":20776.1,"high":20800.64,"low":20646.15,"open":20667.89,"time":"2019-06-05"},
	{"close":20774.04,"high":20842.28,"low":20745.84,"open":20745.84,"time":"2019-06-06"},
	{"close":20884.71,"high":20907.77,"low":20816.58,"open":20859.78,"time":"2019-06-07"},
	{"close":21134.42,"high":21166.12,"low":21077.95,"open":21095.4,"time":"2019-06-10"},
	{"close":21204.28,"high":21227.18,"low":21066.62,"open":21099.54,"time":"2019-06-11"},
	{"close":21129.72,"high":21259.7,"low":21118.75,"open":21130.39,"time":"2019-06-12"},
	{"close":21032.0,"high":21111.23,"low":20932.13,"open":21040.91,"time":"2019-06-13"},
	{"close":21116.89,"high":21119.73,"low":20971.18,"open":21049.41,"time":"2019-06-14"},
	{"close":21124.0,"high":21185.25,"low":21044.62,"open":21094.96,"time":"2019-06-17"},
	{"close":20972.71,"high":21153.65,"low":20924.19,"open":21111.77,"time":"2019-06-18"},
	{"close":21333.87,"high":21358.72,"low":21213.43,"open":21223.17,"time":"2019-06-19"},
	{"close":21462.86,"high":21491.39,"low":21377.27,"open":21417.74,"time":"2019-06-20"},
	{"close":21258.64,"high":21497.82,"low":21221.7,"open":21487.67,"time":"2019-06-21"},
	{"close":21285.99,"high":21317.86,"low":21185.67,"open":21223.56,"time":"2019-06-24"},
	{"close":21193.81,"high":21313.77,"low":21114.47,"open":21238.07,"time":"2019-06-25"},
	{"close":21086.59,"high":21129.64,"low":21035.84,"open":21067.68,"time":"2019-06-26"},
	{"close":21338.17,"high":21338.17,"low":21123.97,"open":21156.88,"time":"2019-06-27"},
	{"close":21275.92,"high":21324.93,"low":21199.85,"open":21282.22,"time":"2019-06-28"},
	{"close":21729.97,"high":21758.34,"low":21559.17,"open":21566.27,"time":"2019-07-01"},
	{"close":21754.27,"high":21784.22,"low":21697.31,"open":21699.43,"time":"2019-07-02"},
	{"close":21638.16,"high":21708.72,"low":21566.65,"open":21684.07,"time":"2019-07-03"},
	{"close":21702.45,"high":21755.63,"low":21672.5,"open":21740.93,"time":"2019-07-04"},
	{"close":21746.38,"high":21746.38,"low":21647.73,"open":21703.61,"time":"2019-07-05"},
	{"close":21534.35,"high":21672.65,"low":21499.57,"open":21665.79,"time":"2019-07-08"},
	{"close":21565.15,"high":21687.29,"low":21508.22,"open":21598.15,"time":"2019-07-09"},
	{"close":21533.48,"high":21601.86,"low":21488.22,"open":21499.46,"time":"2019-07-10"},
	{"close":21643.53,"high":21649.93,"low":21532.57,"open":21547.19,"time":"2019-07-11"},
	{"close":21685.9,"high":21720.14,"low":21589.83,"open":21720.14,"time":"2019-07-12"},
	{"close":21535.25,"high":21655.52,"low":21514.89,"open":21644.38,"time":"2019-07-16"},
	{"close":21469.18,"high":21488.27,"low":21380.55,"open":21474.63,"time":"2019-07-17"},
	{"close":21046.24,"high":21347.84,"low":20993.44,"open":21336.8,"time":"2019-07-18"},
	{"close":21466.99,"high":21474.3,"low":21121.9,"open":21146.5,"time":"2019-07-19"},
	{"close":21416.79,"high":21445.03,"low":21317.85,"open":21394.75,"time":"2019-07-22"},
	{"close":21620.88,"high":21686.53,"low":21411.93,"open":21425.44,"time":"2019-07-23"},
	{"close":21709.57,"high":21744.88,"low":21677.71,"open":21726.98,"time":"2019-07-24"},
	{"close":21756.55,"high":21823.07,"low":21715.69,"open":21715.95,"time":"2019-07-25"},
	{"close":21658.15,"high":21709.74,"low":21590.66,"open":21700.2,"time":"2019-07-26"},
	{"close":21616.8,"high":21652.95,"low":21518.7,"open":21627.55,"time":"2019-07-29"},
	{"close":21709.31,"high":21792.98,"low":21665.86,"open":21681.82,"time":"2019-07-30"},
	{"close":21521.53,"high":21589.11,"low":21476.07,"open":21526.38,"time":"2019-07-31"},
	{"close":21540.99,"high":21556.69,"low":21288.9,"open":21361.58,"time":"2019-08-01"},
	{"close":21087.16,"high":21211.06,"low":20960.09,"open":21211.06,"time":"2019-08-02"},
	{"close":20720.29,"high":20941.83,"low":20514.19,"open":20909.98,"time":"2019-08-05"},
	{"close":20585.31,"high":20607.83,"low":20110.76,"open":20325.52,"time":"2019-08-06"},
	{"close":20516.56,"high":20570.19,"low":20406.52,"open":20548.07,"time":"2019-08-07"},
	{"close":20593.35,"high":20682.24,"low":20462.98,"open":20529.29,"time":"2019-08-08"},
	{"close":20684.82,"high":20782.06,"low":20676.92,"open":20758.15,"time":"2019-08-09"},
	{"close":20455.44,"high":20503.38,"low":20369.27,"open":20432.68,"time":"2019-08-13"},
	{"close":20655.13,"high":20697.42,"low":20581.17,"open":20669.99,"time":"2019-08-14"},
	{"close":20405.65,"high":20419.88,"low":20184.85,"open":20324.25,"time":"2019-08-15"},
	{"close":20418.81,"high":20465.71,"low":20300.35,"open":20323.97,"time":"2019-08-16"},
	{"close":20563.16,"high":20633.9,"low":20502.66,"open":20590.47,"time":"2019-08-19"},
	{"close":20677.22,"high":20684.06,"low":20582.01,"open":20605.35,"time":"2019-08-20"},
	{"close":20618.57,"high":20626.05,"low":20482.62,"open":20489.97,"time":"2019-08-21"},
	{"close":20628.01,"high":20731.19,"low":20584.29,"open":20706.07,"time":"2019-08-22"},
	{"close":20710.91,"high":20719.31,"low":20579.98,"open":20579.98,"time":"2019-08-23"},
	{"close":20261.04,"high":20329.01,"low":20173.76,"open":20325.44,"time":"2019-08-26"},
	{"close":20456.08,"high":20529.94,"low":20439.92,"open":20467.22,"time":"2019-08-27"},
	{"close":20479.42,"high":20511.21,"low":20433.31,"open":20474.31,"time":"2019-08-28"},
	{"close":20460.93,"high":20520.68,"low":20361.12,"open":20500.5,"time":"2019-08-29"},
	{"close":20704.37,"high":20748.35,"low":20633.3,"open":20641.49,"time":"2019-08-30"},
	{"close":20620.19,"high":20667.56,"low":20614.29,"open":20625.75,"time":"2019-09-02"},
	{"close":20625.16,"high":20662.23,"low":20578.02,"open":20581.58,"time":"2019-09-03"},
	{"close":20649.14,"high":20694.35,"low":20554.16,"open":20578.67,"time":"2019-09-04"},
	{"close":21085.94,"high":21164.61,"low":20787.93,"open":20800.29,"time":"2019-09-05"},
	{"close":21199.57,"high":21241.29,"low":21145.81,"open":21201.83,"time":"2019-09-06"},
	{"close":21318.42,"high":21333.51,"low":21182.26,"open":21214.56,"time":"2019-09-09"},
	{"close":21392.1,"high":21438.35,"low":21350.35,"open":21363.57,"time":"2019-09-10"},
	{"close":21597.76,"high":21619.21,"low":21437.82,"open":21466.66,"time":"2019-09-11"},
	{"close":21759.61,"high":21825.92,"low":21743.96,"open":21761.09,"time":"2019-09-12"},
	{"close":21988.29,"high":22019.66,"low":21820.94,"open":21907.83,"time":"2019-09-13"},
	{"close":22001.32,"high":22041.08,"low":21878.63,"open":21947.59,"time":"2019-09-17"},
	{"close":21960.71,"high":22027.86,"low":21942.03,"open":22014.65,"time":"2019-09-18"},
	{"close":22044.45,"high":22255.56,"low":22003.3,"open":22064.46,"time":"2019-09-19"},
	{"close":22079.09,"high":22204.75,"low":22047.9,"open":22130.74,"time":"2019-09-20"},
	{"close":22098.84,"high":22168.74,"low":22077.94,"open":22095.35,"time":"2019-09-24"},
	{"close":22020.15,"high":22036.48,"low":21906.0,"open":21961.82,"time":"2019-09-25"},
	{"close":22048.24,"high":22184.91,"low":21986.24,"open":22160.52,"time":"2019-09-26"},
	{"close":21878.9,"high":21955.79,"low":21733.69,"open":21934.93,"time":"2019-09-27"},
	{"close":21755.84,"high":21811.98,"low":21666.6,"open":21793.83,"time":"2019-09-30"},
	{"close":21885.24,"high":21938.77,"low":21811.98,"open":21831.44,"time":"2019-10-01"},
	{"close":21778.61,"high":21795.01,"low":21725.23,"open":21744.62,"time":"2019-10-02"},
	{"close":21341.74,"high":21437.74,"low":21277.36,"open":21422.22,"time":"2019-10-03"},
	{"close":21410.2,"high":21410.2,"low":21276.01,"open":21316.18,"time":"2019-10-04"},
	{"close":21375.25,"high":21475.28,"low":21328.26,"open":21445.73,"time":"2019-10-07"},
	{"close":21587.78,"high":21629.24,"low":21483.18,"open":21494.48,"time":"2019-10-08"},
	{"close":21456.38,"high":21467.77,"low":21359.84,"open":21359.84,"time":"2019-10-09"},
	{"close":21551.98,"high":21601.46,"low":21308.88,"open":21456.27,"time":"2019-10-10"},
	{"close":21798.87,"high":21820.77,"low":21658.27,"open":21749.93,"time":"2019-10-11"},
	{"close":22207.21,"high":22219.63,"low":22049.71,"open":22063.71,"time":"2019-10-15"},
	{"close":22472.92,"high":22615.47,"low":22434.35,"open":22479.57,"time":"2019-10-16"},
	{"close":22451.86,"high":22522.39,"low":22424.92,"open":22451.15,"time":"2019-10-17"},
	{"close":22492.68,"high":22649.85,"low":22466.26,"open":22528.56,"time":"2019-10-18"},
	{"close":22548.9,"high":22581.28,"low":22515.73,"open":22541.22,"time":"2019-10-21"},
	{"close":22625.38,"high":22648.81,"low":22457.89,"open":22619.77,"time":"2019-10-23"},
	{"close":22750.6,"high":22780.99,"low":22704.33,"open":22725.44,"time":"2019-10-24"},
	{"close":22799.81,"high":22819.92,"low":22715.13,"open":22753.24,"time":"2019-10-25"},
	{"close":22867.27,"high":22896.22,"low":22830.57,"open":22854.44,"time":"2019-10-28"},
	{"close":22974.13,"high":23008.43,"low":22935.35,"open":22950.79,"time":"2019-10-29"},
	{"close":22843.12,"high":22961.23,"low":22827.93,"open":22953.17,"time":"2019-10-30"},
	{"close":22927.04,"high":22988.8,"low":22875.5,"open":22910.1,"time":"2019-10-31"},
	{"close":22850.77,"high":22852.72,"low":22705.6,"open":22730.49,"time":"2019-11-01"}
];

// 日足の表示原点とオフセット
const OriginDate = '2019-09-02';
const RightOffset = - Nikkei225.filter(x => x.time > OriginDate).length;

// LightweightCharts 生成
var chart = LightweightCharts.createChart(document.getElementById('nikkei225'), {
	width: 800,
	height: 400,
	layout: {
		backgroundColor: '#eee',
		textColor: 'rgba(80, 80, 80, 0.9)',
	},
	grid: {
		vertLines: {
			color: 'rgba(80, 80, 80, 0.3)',
		},
		horzLines: {
			color: 'rgba(80, 80, 80, 0.3)',
		},
	},
	crosshair: {
		mode: LightweightCharts.CrosshairMode.Normal,
	},
	priceScale: {
		borderColor: 'rgba(197, 203, 206, 0.8)',
	},
	timeScale: {
		borderColor: 'rgba(197, 203, 206, 0.8)',
	},
	localization: {
		locale: 'ja-JP',
		dateFormat: 'yyyy/MM/dd',
	}
});

// マウスホイールでのピンチイン・アウトはオフに
chart.applyOptions({
	handleScale: {
		axisPressedMouseMove: false,
		mouseWheel: false,
		pinch: false,
	},
});

// 初期表示位置を設定
chart.applyOptions({
	timeScale: {
		rightOffset: RightOffset,
	}
});

// ローソク足チャート生成
var candleSeries = chart.addCandlestickSeries({
	upColor: 'rgba(0, 180, 0, 1)',
	downColor: 'rgba(230, 0, 0, 1)',
	borderDownColor: 'rgba(230, 0, 0, 1)',
	borderUpColor: 'rgba(0, 180, 0, 1)',
	wickDownColor: 'rgba(230, 0, 0, 1)',
	wickUpColor: 'rgba(0, 180, 0, 1)',
});

candleSeries.setData(Nikkei225);

// 原点日にマーカ作画
candleSeries.setMarkers([
	{
		time: OriginDate,
		position: 'aboveBar',
		color: 'black',
		shape: 'arrowDown',
	},
]);

// キー入力処理
var currentRightOffset = RightOffset;
document.addEventListener('keyup', function(e){
	if (e.code == 'ArrowRight') {
		chart.applyOptions({
			timeScale: {
				rightOffset: ++currentRightOffset,
			}
		});
	}
	else if (e.code == 'ArrowLeft') {
		chart.applyOptions({
			timeScale: {
				rightOffset: --currentRightOffset,
			}
		});
	}
	else if (e.code == 'Home') {
		chart.applyOptions({
			timeScale: {
				rightOffset: currentRightOffset = RightOffset,
			}
		});
	}
});
              
            
!
999px

Console